updated asset folder
This commit is contained in:
parent
86ea05b574
commit
d4d4d31cbb
154
public/asset/1
154
public/asset/1
|
|
@ -2,12 +2,18 @@
|
|||
-- Creates all neccessary scripts for the gui on initial load, everything except build tools
|
||||
-- Created by Ben T. 10/29/10
|
||||
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
|
||||
local scriptContext = game:GetService("ScriptContext")
|
||||
local touchEnabled = false
|
||||
pcall(function() touchEnabled = game:GetService("UserInputService").TouchEnabled end)
|
||||
|
||||
-- library registration
|
||||
scriptContext:AddCoreScript(2, scriptContext,"/Libraries/LibraryRegistration/LibraryRegistration")
|
||||
local deepakTestingPlace = 3569749
|
||||
|
||||
pcall(function()
|
||||
local sc = game:GetService("ScriptContext")
|
||||
sc:RegisterLibrary("RbxGui", "13")
|
||||
sc:RegisterLibrary("RbxGear", "14")
|
||||
if game.PlaceId == deepakTestingPlace then
|
||||
sc:RegisterLibrary("RbxStatus", "52177566")
|
||||
end
|
||||
sc:LibraryRegistrationComplete()
|
||||
end)
|
||||
|
||||
local function waitForChild(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
|
|
@ -20,94 +26,80 @@ local function waitForProperty(instance, property)
|
|||
end
|
||||
end
|
||||
|
||||
-- Responsible for tracking logging items
|
||||
local scriptContext = game:GetService("ScriptContext")
|
||||
scriptContext:AddCoreScript(3, scriptContext, "CoreScripts/Sections")
|
||||
|
||||
local backpackTestPlaces = {41324860,87241143,1818,65033,25415,14403,33913,21783593,17467963,3271,16184658}
|
||||
|
||||
waitForChild(game:GetService("CoreGui"),"RobloxGui")
|
||||
local screenGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
|
||||
|
||||
if not touchEnabled then
|
||||
-- ToolTipper (creates tool tips for gui)
|
||||
scriptContext:AddCoreScript(4,screenGui,"CoreScripts/ToolTip")
|
||||
-- SettingsScript
|
||||
scriptContext:AddCoreScript(5,screenGui,"CoreScripts/Settings")
|
||||
local scriptContext = game:GetService("ScriptContext")
|
||||
|
||||
-- Resizer (dynamically resizes gui)
|
||||
scriptContext:AddCoreScript(2,screenGui,"Resizer")
|
||||
|
||||
-- SubMenuBuilder (builds out the material,surface and color panels)
|
||||
scriptContext:AddCoreScript(3,screenGui,"SubMenuBuilder")
|
||||
|
||||
-- ToolTipper (creates tool tips for gui)
|
||||
scriptContext:AddCoreScript(4,screenGui,"ToolTipper")
|
||||
|
||||
if game.CoreGui.Version < 2 then
|
||||
-- (controls the movement and selection of sub panels)
|
||||
-- PaintMenuMover
|
||||
scriptContext:AddCoreScript(36040464,screenGui.BuildTools.Frame.PropertyTools.PaintTool,"PaintMenuMover")
|
||||
-- MaterialMenuMover
|
||||
scriptContext:AddCoreScript(36040495,screenGui.BuildTools.Frame.PropertyTools.MaterialSelector,"MaterialMenuMover")
|
||||
-- InputMenuMover
|
||||
scriptContext:AddCoreScript(36040483,screenGui.BuildTools.Frame.PropertyTools.InputSelector,"InputMenuMover")
|
||||
end
|
||||
|
||||
-- SettingsScript
|
||||
scriptContext:AddCoreScript(5,screenGui,"SettingsScript")
|
||||
|
||||
-- MainBotChatScript
|
||||
scriptContext:AddCoreScript(6,screenGui,"MainBotChatScript")
|
||||
|
||||
if game.CoreGui.Version >= 2 then
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(7,screenGui,"PlayerListScript")
|
||||
-- Popup Script
|
||||
scriptContext:AddCoreScript(8,screenGui,"PopupScript")
|
||||
-- Friend Notification Script (probably can use this script to expand out to other notifications)
|
||||
scriptContext:AddCoreScript(9,screenGui,"NotificationScript")
|
||||
scriptContext:AddCoreScript(38037265,screenGui,"HealthScript 4.0")
|
||||
-- Chat script
|
||||
scriptContext:AddCoreScript(1000, screenGui, "CoreScripts/ChatScript")
|
||||
end
|
||||
|
||||
-- For Deepak Testing
|
||||
pcall(function()
|
||||
waitForProperty(game,"PlaceId")
|
||||
if game.PlaceId == deepakTestingPlace then
|
||||
scriptContext:AddCoreScript(52177626,screenGui,"RBXStatusBuffsGUIScript")
|
||||
scriptContext:AddCoreScript(52177626,screenGui,"RBXStatusBuffsGUIScript")
|
||||
end
|
||||
end)
|
||||
|
||||
-- MainBotChatScript
|
||||
scriptContext:AddCoreScript(6,screenGui,"CoreScripts/MainBotChatScript")
|
||||
|
||||
-- Popup Script
|
||||
scriptContext:AddCoreScript(7,screenGui,"CoreScripts/PopupScript")
|
||||
-- Friend Notification Script (probably can use this script to expand out to other notifications)
|
||||
scriptContext:AddCoreScript(8,screenGui,"CoreScripts/NotificationScript")
|
||||
-- Chat script
|
||||
scriptContext:AddCoreScript(9, screenGui, "CoreScripts/ChatScript")
|
||||
-- Purchase Prompt Script
|
||||
scriptContext:AddCoreScript(10, screenGui, "CoreScripts/PurchasePromptScript")
|
||||
|
||||
if not touchEnabled then
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(11,screenGui,"CoreScripts/PlayerListScript")
|
||||
elseif screenGui.AbsoluteSize.Y > 600 then
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(11,screenGui,"CoreScripts/PlayerListScript")
|
||||
else
|
||||
delay(5, function()
|
||||
if screenGui.AbsoluteSize.Y >= 600 then
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(11,screenGui,"CoreScripts/PlayerListScript")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if game.CoreGui.Version >= 3 then
|
||||
-- Backpack Builder, creates most of the backpack gui
|
||||
scriptContext:AddCoreScript(12,screenGui,"CoreScripts/BackpackScripts/BackpackBuilder")
|
||||
|
||||
waitForProperty(game,"PlaceId")
|
||||
local inRightPlace = true
|
||||
for i,v in ipairs(backpackTestPlaces) do
|
||||
if v == game.PlaceId then
|
||||
inRightPlace = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
waitForChild(game,"Players")
|
||||
waitForProperty(game.Players,"LocalPlayer")
|
||||
if game.Players.LocalPlayer.userId == 7210880 or game.Players.LocalPlayer.userId == 0 then inRightPlace = true end
|
||||
|
||||
if not inRightPlace then return end -- restricting availability of backpack
|
||||
|
||||
-- Backpack Builder
|
||||
scriptContext:AddCoreScript(10,screenGui,"BackpackBuilder")
|
||||
waitForChild(screenGui,"CurrentLoadout")
|
||||
waitForChild(screenGui,"Backpack")
|
||||
local Backpack = screenGui.Backpack
|
||||
|
||||
-- Manager handles all big backpack state changes, other scripts subscribe to this and do things accordingly
|
||||
if game.CoreGui.Version >= 7 then
|
||||
scriptContext:AddCoreScript(13,Backpack,"CoreScripts/BackpackScripts/BackpackManager")
|
||||
end
|
||||
|
||||
-- Backpack Gear (handles all backpack gear tab stuff)
|
||||
game:GetService("ScriptContext"):AddCoreScript(14,Backpack,"CoreScripts/BackpackScripts/BackpackGear")
|
||||
-- Loadout Script, used for gear hotkeys
|
||||
scriptContext:AddCoreScript(15,screenGui.CurrentLoadout,"CoreScripts/BackpackScripts/LoadoutScript")
|
||||
if game.CoreGui.Version >= 8 then
|
||||
-- Wardrobe script handles all character dressing operations
|
||||
scriptContext:AddCoreScript(-1,Backpack,"CoreScripts/BackpackScripts/BackpackWardrobe")
|
||||
end
|
||||
end
|
||||
|
||||
local IsPersonalServer = not not game.Workspace:FindFirstChild("PSVariable")
|
||||
if IsPersonalServer then
|
||||
game:GetService("ScriptContext"):AddCoreScript(16,game.Players.LocalPlayer,"BuildToolManager")
|
||||
end
|
||||
game.Workspace.ChildAdded:connect(function(nchild)
|
||||
if nchild.Name=='PSVariable' and nchild:IsA('BoolValue') then
|
||||
IsPersonalServer = true
|
||||
game:GetService("ScriptContext"):AddCoreScript(16,game.Players.LocalPlayer,"BuildToolManager")
|
||||
end
|
||||
end)
|
||||
|
||||
if touchEnabled then -- touch devices don't use same control frame
|
||||
waitForChild(screenGui, 'ControlFrame')
|
||||
waitForChild(screenGui.ControlFrame, 'BottomLeftControl')
|
||||
screenGui.ControlFrame.BottomLeftControl.Visible = false
|
||||
|
||||
waitForChild(screenGui.ControlFrame, 'TopLeftControl')
|
||||
screenGui.ControlFrame.TopLeftControl.Visible = false
|
||||
end
|
||||
waitForChild(screenGui.CurrentLoadout,"TempSlot")
|
||||
waitForChild(screenGui.CurrentLoadout.TempSlot,"SlotNumber")
|
||||
-- Backpack Script
|
||||
scriptContext:AddCoreScript(12,screenGui.CurrentLoadout,"BackpackScript")
|
||||
end
|
||||
1414
public/asset/10
1414
public/asset/10
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,939 @@
|
|||
%1000%
|
||||
--[[
|
||||
//FileName: ChatScript.LUA
|
||||
//Written by: Sorcus
|
||||
//Description: Code for lua side chat on ROBLOX. Supports Scrolling.
|
||||
//NOTE: If you find any bugs or inaccuracies PM Sorcus on ROBLOX or @Canavus on Twitter
|
||||
]]
|
||||
|
||||
-- Utility functions + Globals
|
||||
local function WaitForChild(parent, childName)
|
||||
while parent:FindFirstChild(childName) == nil do
|
||||
wait()
|
||||
end
|
||||
return parent[childName]
|
||||
end
|
||||
|
||||
local function typedef(obj)
|
||||
return obj
|
||||
end
|
||||
|
||||
while Game.Players.LocalPlayer == nil do wait() end
|
||||
|
||||
local Player = Game.Players.LocalPlayer
|
||||
while Player.Character == nil do wait() end
|
||||
local RbxUtility = LoadLibrary('RbxUtility')
|
||||
local Gui = typedef(RbxUtility)
|
||||
local Camera = Game.Workspace.CurrentCamera
|
||||
|
||||
-- Services
|
||||
local CoreGuiService = Game:GetService('CoreGui')
|
||||
local PlayersService = Game:GetService('Players')
|
||||
local DebrisService= Game:GetService('Debris')
|
||||
local GuiService = Game:GetService('GuiService')
|
||||
|
||||
-- Lua Enums
|
||||
local Enums do
|
||||
Enums = {}
|
||||
local EnumName = {} -- used as unique key for enum name
|
||||
local enum_mt = {
|
||||
__call = function(self,value)
|
||||
return self[value] or self[tonumber(value)]
|
||||
end;
|
||||
__index = {
|
||||
GetEnumItems = function(self)
|
||||
local t = {}
|
||||
for i,item in pairs(self) do
|
||||
if type(i) == 'number' then
|
||||
t[#t+1] = item
|
||||
end
|
||||
end
|
||||
table.sort(t,function(a,b) return a.Value < b.Value end)
|
||||
return t
|
||||
end;
|
||||
};
|
||||
__tostring = function(self)
|
||||
return "Enum." .. self[EnumName]
|
||||
end;
|
||||
}
|
||||
local item_mt = {
|
||||
__call = function(self,value)
|
||||
return value == self or value == self.Name or value == self.Value
|
||||
end;
|
||||
__tostring = function(self)
|
||||
return "Enum." .. self[EnumName] .. "." .. self.Name
|
||||
end;
|
||||
}
|
||||
function CreateEnum(enumName)
|
||||
return function(t)
|
||||
local e = {[EnumName] = enumName}
|
||||
for i,name in pairs(t) do
|
||||
local item = setmetatable({Name=name,Value=i,Enum=e,[EnumName]=enumName},item_mt)
|
||||
e[i] = item
|
||||
e[name] = item
|
||||
e[item] = item
|
||||
end
|
||||
Enums[enumName] = e
|
||||
return setmetatable(e, enum_mt)
|
||||
end
|
||||
end
|
||||
end
|
||||
---------------------------------------------------
|
||||
------------------ Input class --------------------
|
||||
local Input = {
|
||||
Mouse = Player:GetMouse(),
|
||||
Speed = 0,
|
||||
Simulating = false,
|
||||
|
||||
Configuration = {
|
||||
DefaultSpeed = 1
|
||||
},
|
||||
UserIsScrolling = false
|
||||
}
|
||||
|
||||
---------------------------------------------------
|
||||
------------------ Chat class --------------------
|
||||
local Chat = {
|
||||
|
||||
ChatColors = {
|
||||
BrickColor.new("Bright red"),
|
||||
BrickColor.new("Bright blue"),
|
||||
BrickColor.new("Earth green"),
|
||||
BrickColor.new("Bright violet"),
|
||||
BrickColor.new("Bright orange"),
|
||||
BrickColor.new("Bright yellow"),
|
||||
BrickColor.new("Light reddish violet"),
|
||||
BrickColor.new("Brick yellow"),
|
||||
},
|
||||
|
||||
Gui = nil,
|
||||
Frame = nil,
|
||||
RenderFrame = nil,
|
||||
TapToChatLabel = nil,
|
||||
ClickToChatButton = nil,
|
||||
|
||||
ScrollingLock = false,
|
||||
EventListener = nil,
|
||||
|
||||
-- This is actually a ring buffer
|
||||
-- Meaning at hitting the historyLength it wraps around
|
||||
-- Reuses the text objects, so chat atmost uses 100 text objects
|
||||
MessageQueue = {},
|
||||
|
||||
-- Stores all the values for configuring chat
|
||||
Configuration = {
|
||||
FontSize = Enum.FontSize.Size10, -- 10 is good
|
||||
-- Also change this when you are changing the above, this is suboptimal but so is our interface to find FontSize
|
||||
NumFontSize = 10,
|
||||
HistoryLength = 50, -- stores up to 50 of the last chat messages for you to scroll through,
|
||||
Size = UDim2.new(0.38, 0, 0.20, 0),
|
||||
MessageColor = Color3.new(1, 1, 1),
|
||||
XScale = 0.025,
|
||||
LifeTime = 45,
|
||||
Position = UDim2.new(0, 2, 0.05, 0),
|
||||
DefaultTweenSpeed = 0.15,
|
||||
},
|
||||
|
||||
-- This could be redone by just using the previous and next fields of the Queue
|
||||
-- But the iterators cause issues, will be optimized later
|
||||
SlotPositions_List = {},
|
||||
-- To precompute and store all player null strings since its an expensive process
|
||||
CachedSpaceStrings_List = {},
|
||||
MouseOnFrame = false,
|
||||
GotFocus = false,
|
||||
|
||||
SafeChat_List = {
|
||||
['Use the Chat menu to talk to me.'] = {'/sc 0', true},
|
||||
['I can only see menu chats.'] = {'/sc 1', true},
|
||||
['Hello'] = {
|
||||
['Hi'] = {'/sc 2_0', true, ['Hi there!'] = true, ['Hi everyone'] = true},
|
||||
['Howdy'] = {'/sc 2_1', true, ['Howdy partner!'] = true},
|
||||
['Greetings'] = {'/sc 2_2', true, ['Greetings everyone'] = true, ['Greetings Robloxians!'] = true, ['Seasons greetings!'] = true},
|
||||
['Welcome'] = {'/sc 2_3', true, ['Welcome to my place'] = true, ['Welcome to my barbeque'] = true, ['Welcome to our base'] = true},
|
||||
['Hey there!'] = {'/sc 2_4', true},
|
||||
['What\'s up?'] = {'/sc 2_5', true, ['How are you doing?'] = true, ['How\'s it going?'] = true, ['What\'s new?'] = true},
|
||||
['Good day'] = {'/sc 2_6', true, ['Good morning'] = true, ['Good evening'] = true, ['Good afternoon'] = true, ['Good night'] = true},
|
||||
['Silly'] = {'/sc 2_7', true, ['Waaaaaaaz up?!'] = true, ['Hullo!'] = true, ['Behold greatness, mortals!'] = true, ['Pardon me, is this Sparta?'] = true, ['THIS IS SPARTAAAA!'] = true},
|
||||
['Happy Holidays!'] = {'/sc 2_8', true, ['Happy New Year!'] = true,
|
||||
['Happy Valentine\'s Day!'] = true,
|
||||
['Beware the Ides of March!'] = true,
|
||||
['Happy St. Patrick\'s Day!'] = true,
|
||||
['Happy Easter!'] = true,
|
||||
['Happy Earth Day!'] = true,
|
||||
['Happy 4th of July!'] = true,
|
||||
['Happy Thanksgiving!'] = true,
|
||||
['Happy Halloween!'] = true,
|
||||
['Happy Hanukkah!'] = true,
|
||||
['Merry Christmas!'] = true,
|
||||
['Happy Halloween!'] = true,
|
||||
['Happy Earth Day!'] = true,
|
||||
['Happy May Day!'] = true,
|
||||
['Happy Towel Day!'] = true,
|
||||
['Happy ROBLOX Day!'] = true,
|
||||
['Happy LOL Day!'] = true },
|
||||
|
||||
[1] = '/sc 2'
|
||||
},
|
||||
['Goodbye'] = {
|
||||
['Good Night']= {'/sc 3_0', true,
|
||||
['Sweet dreams'] = true,
|
||||
['Go to sleep!'] = true,
|
||||
['Lights out!'] = true,
|
||||
['Bedtime'] = true,
|
||||
['Going to bed now'] = true},
|
||||
|
||||
['Later']= {'/sc 3_1', true,
|
||||
['See ya later'] = true,
|
||||
['Later gator!'] = true,
|
||||
['See you tomorrow'] = true},
|
||||
|
||||
['Bye'] = {'/sc 3_2', true, ['Hasta la bye bye!'] = true},
|
||||
['I\'ll be right back'] = {'/sc 3_3', true},
|
||||
['I have to go'] = {'/sc 3_4', true},
|
||||
['Farewell'] = {'/sc 3_5', true, ['Take care'] = true, ['Have a nice day'] = true, ['Goodluck!'] = true, ['Ta-ta for now!'] = true},
|
||||
['Peace'] = {'/sc 3_6', true, ['Peace out!'] = true, ['Peace dudes!'] = true, ['Rest in pieces!'] = true},
|
||||
['Silly'] = {'/sc 3_7', true,
|
||||
['To the batcave!'] = true,
|
||||
['Over and out!'] = true,
|
||||
['Happy trails!'] = true,
|
||||
['I\'ve got to book it!'] = true,
|
||||
['Tootles!'] = true,
|
||||
['Smell you later!'] = true,
|
||||
['GG!'] = true,
|
||||
['My house is on fire! gtg.'] = true},
|
||||
[1] = '/sc 3'
|
||||
},
|
||||
['Friend'] ={
|
||||
['Wanna be friends?'] = {'/sc 4_0', true},
|
||||
['Follow me'] = {'/sc 4_1', true, ['Come to my place!'] = true, ['Come to my base!'] = true, ['Follow me, team!'] = true, ['Follow me'] = true},
|
||||
['Your place is cool'] = {'/sc 4_2', true, ['Your place is fun'] = true, ['Your place is awesome'] = true, ['Your place looks good'] = true, ['This place is awesome!'] = true},
|
||||
['Thank you'] = {'/sc 4_3', true, ['Thanks for playing'] = true, ['Thanks for visiting'] = true, ['Thanks for everything'] = true, ['No, thank you'] = true, ['Thanx'] = true},
|
||||
['No problem'] = {'/sc 4_4', true, ['Don\'t worry'] = true, ['That\'s ok'] = true, ['np'] = true},
|
||||
['You are ...'] = {'/sc 4_5', true,
|
||||
['You are great!'] = true,
|
||||
['You are good!'] = true,
|
||||
['You are cool!'] = true,
|
||||
['You are funny!'] = true,
|
||||
['You are silly!'] = true,
|
||||
['You are awesome!'] = true,
|
||||
['You are doing something I don\'t like, please stop'] = true
|
||||
},
|
||||
['I like ...'] = {'/sc 4_6', true, ['I like your name'] = true, ['I like your shirt'] = true, ['I like your place'] = true, ['I like your style'] = true,
|
||||
['I like you'] = true, ['I like items'] = true, ['I like money'] = true},
|
||||
['Sorry'] = {'/sc 4_7', true, ['My bad!'] = true, ['I\'m sorry'] = true, ['Whoops!'] = true, ['Please forgive me.'] = true, ['I forgive you.'] = true,
|
||||
['I didn\'t mean to do that.'] = true, ['Sorry, I\'ll stop now.'] = true},
|
||||
[1] = '/sc 4'
|
||||
},
|
||||
['Questions'] = {
|
||||
['Who?'] = {'/sc 5_0', true, ['Who wants to be my friend?'] = true, ['Who wants to be on my team?'] = true, ['Who made this brilliant game?'] = true},
|
||||
['What?'] = {'/sc 5_1', true, ['What is your favorite animal?'] = true, ['What is your favorite game?'] = true, ['What is your favorite movie?'] = true,
|
||||
['What is your favorite TV show?'] = true, ['What is your favorite music?'] = true, ['What are your hobbies?'] = true, ['LOLWUT?'] = true},
|
||||
['When?'] = {'/sc 5_2', true, ['When are you online?'] = true, ['When is the new version coming out?'] = true, ['When can we play again?'] = true, ['When will your place be done?'] = true},
|
||||
['Where?'] = {'/sc 5_3', true, ['Where do you want to go?'] = true, ['Where are you going?'] = true, ['Where am I?!'] = true, ['Where did you go?'] = true},
|
||||
['How?'] = {'/sc 5_4', true, ['How are you today?'] = true, ['How did you make this cool place?'] = true, ['LOLHOW?'] = true},
|
||||
['Can I...'] = {'/sc 5_5', true, ['Can I have a tour?'] = true, ['Can I be on your team?'] = true, ['Can I be your friend?'] = true, ['Can I try something?'] = true,
|
||||
['Can I have that please?'] = true, ['Can I have that back please?'] = true, ['Can I have borrow your hat?'] = true, ['Can I have borrow your gear?'] = true},
|
||||
[1] = '/sc 5'
|
||||
},
|
||||
['Answers'] = {
|
||||
['You need help?'] = {'/sc 6_0', true, ['Check out the news section'] = true, ['Check out the help section'] = true, ['Read the wiki!'] = true,
|
||||
['All the answers are in the wiki!'] = true, ['I will help you with this.'] = true},
|
||||
['Some people ...'] = {'/sc 6_1', true, ['Me'] = true, ['Not me'] = true, ['You'] = true, ['All of us'] = true, ['Everyone but you'] = true, ['Builderman!'] = true,
|
||||
['Telamon!'] = true, ['My team'] = true, ['My group'] = true, ['Mom'] = true, ['Dad'] = true, ['Sister'] = true, ['Brother'] = true, ['Cousin'] = true,
|
||||
['Grandparent'] = true, ['Friend'] = true},
|
||||
['Time ...'] = {'/sc 6_2', true, ['In the morning'] = true, ['In the afternoon'] = true, ['At night'] = true, ['Tomorrow'] = true, ['This week'] = true, ['This month'] = true,
|
||||
['Sometime'] = true, ['Sometimes'] = true, ['Whenever you want'] = true, ['Never'] = true, ['After this'] = true, ['In 10 minutes'] = true, ['In a couple hours'] = true,
|
||||
['In a couple days'] = true},
|
||||
['Animals'] = {'/sc 6_3', true,
|
||||
['Cats'] = {['Lion'] = true, ['Tiger'] = true, ['Leopard'] = true, ['Cheetah'] = true},
|
||||
['Dogs'] = {['Wolves'] = true, ['Beagle'] = true, ['Collie'] = true, ['Dalmatian'] = true, ['Poodle'] = true, ['Spaniel'] = true,
|
||||
['Shepherd'] = true, ['Terrier'] = true, ['Retriever'] = true},
|
||||
['Horses'] = {['Ponies'] = true, ['Stallions'] = true, ['Pwnyz'] = true},
|
||||
['Reptiles'] = {['Dinosaurs'] = true, ['Lizards'] = true, ['Snakes'] = true, ['Turtles!'] = true},
|
||||
['Hamster'] = true,
|
||||
['Monkey'] = true,
|
||||
['Bears'] = true,
|
||||
['Fish'] = {['Goldfish'] = true, ['Sharks'] = true, ['Sea Bass'] = true, ['Halibut'] = true, ['Tropical Fish'] = true},
|
||||
['Birds'] = {['Eagles'] = true, ['Penguins'] = true, ['Parakeets'] = true, ['Owls'] = true, ['Hawks'] = true, ['Pidgeons'] = true},
|
||||
['Elephants'] = true,
|
||||
['Mythical Beasts'] = {['Dragons'] = true, ['Unicorns'] = true, ['Sea Serpents'] = true, ['Sphinx'] = true, ['Cyclops'] = true,
|
||||
['Minotaurs'] = true, ['Goblins'] = true, ['Honest Politicians'] = true, ['Ghosts'] = true, ['Scylla and Charybdis'] = true}
|
||||
},
|
||||
['Games'] = {'/sc 6_4', true,
|
||||
['Action'] = true, ['Puzzle'] = true, ['Strategy'] = true, ['Racing'] = true, ['RPG'] = true, ['Obstacle Course'] = true, ['Tycoon'] = true,
|
||||
['Roblox'] = { ['BrickBattle'] = true, ['Community Building'] = true, ['Roblox Minigames'] = true, ['Contest Place'] = true},
|
||||
['Board games'] = { ['Chess'] = true, ['Checkers'] = true, ['Settlers of Catan'] = true, ['Tigris and Euphrates'] = true, ['El Grande'] = true,
|
||||
['Stratego'] = true, ['Carcassonne'] = true}
|
||||
},
|
||||
['Sports'] = {'/sc 6_5', true, ['Hockey'] = true, ['Soccer'] = true, ['Football'] = true, ['Baseball'] = true, ['Basketball'] = true,
|
||||
['Volleyball'] = true, ['Tennis'] = true, ['Sports team practice'] = true,
|
||||
['Watersports'] = { ['Surfing'] = true,['Swimming'] = true, ['Water Polo'] = true},
|
||||
['Winter sports'] = { ['Skiing'] = true, ['Snowboarding'] = true, ['Sledding'] = true, ['Skating'] = true},
|
||||
['Adventure'] = {['Rock climbing'] = true, ['Hiking'] = true, ['Fishing'] = true, ['Horseback riding'] = true},
|
||||
['Wacky'] = {['Foosball'] = true, ['Calvinball'] = true, ['Croquet'] = true, ['Cricket'] = true, ['Dodgeball'] = true,
|
||||
['Squash'] = true, ['Trampoline'] = true}
|
||||
},
|
||||
['Movies/TV'] = {'/sc 6_6', true, ['Science Fiction'] = true, ['Animated'] = {['Anime'] = true}, ['Comedy'] = true, ['Romantic'] = true,
|
||||
['Action'] = true, ['Fantasy'] = true},
|
||||
['Music'] = {'/sc 6_7', true, ['Country'] = true, ['Jazz'] = true, ['Rap'] = true, ['Hip-hop'] = true, ['Techno'] = true, ['Classical'] = true,
|
||||
['Pop'] = true, ['Rock'] = true},
|
||||
['Hobbies'] = {'/sc 6_8', true,
|
||||
['Computers'] = { ['Building computers'] = true, ['Videogames'] = true, ['Coding'] = true, ['Hacking'] = true},
|
||||
['The Internet'] = { ['lol. teh internets!'] = true, ['Watching vids'] = true},
|
||||
['Dance'] = true, ['Gymnastics'] = true, ['Listening to music'] = true, ['Arts and crafts'] = true,
|
||||
['Martial Arts'] = {['Karate'] = true, ['Judo'] = true, ['Taikwon Do'] = true, ['Wushu'] = true, ['Street fighting'] = true},
|
||||
['Music lessons'] = {['Playing in my band'] = true, ['Playing piano'] = true, ['Playing guitar'] = true,
|
||||
['Playing violin'] = true, ['Playing drums'] = true, ['Playing a weird instrument'] = true}
|
||||
},
|
||||
['Location'] = {'/sc 6_9', true,
|
||||
['USA'] = {
|
||||
['West'] = { ['Alaska'] = true, ['Arizona'] = true, ['California'] = true, ['Colorado'] = true, ['Hawaii'] = true,
|
||||
['Idaho'] = true, ['Montana'] = true, ['Nevada'] = true, ['New Mexico'] = true, ['Oregon'] = true,
|
||||
['Utah'] = true, ['Washington'] = true, ['Wyoming'] = true
|
||||
},
|
||||
['South'] = { ['Alabama'] = true, ['Arkansas'] = true, ['Florida'] = true, ['Georgia'] = true, ['Kentucky'] = true,
|
||||
['Louisiana'] = true, ['Mississippi'] = true, ['North Carolina'] = true, ['Oklahoma'] = true,
|
||||
['South Carolina'] = true, ['Tennessee'] = true, ['Texas'] = true, ['Virginia'] = true, ['West Virginia'] = true
|
||||
},
|
||||
['Northeast'] = {['Connecticut'] = true, ['Delaware'] = true, ['Maine'] = true, ['Maryland'] = true, ['Massachusetts'] = true,
|
||||
['New Hampshire'] = true, ['New Jersey'] = true, ['New York'] = true, ['Pennsylvania'] = true, ['Rhode Island'] = true,
|
||||
['Vermont'] = true
|
||||
},
|
||||
['Midwest'] = {['Illinois'] = true, ['Indiana'] = true, ['Iowa'] = true, ['Kansas'] = true, ['Michigan'] = true, ['Minnesota'] = true,
|
||||
['Missouri'] = true, ['Nebraska'] = true, ['North Dakota'] = true, ['Ohio'] = true, ['South Dakota'] = true, ['Wisconsin'] = true}
|
||||
},
|
||||
['Canada'] = {['Alberta'] = true, ['British Columbia'] = true, ['Manitoba'] = true, ['New Brunswick'] = true, ['Newfoundland'] = true,
|
||||
['Northwest Territories'] = true, ['Nova Scotia'] = true, ['Nunavut'] = true, ['Ontario'] = true, ['Prince Edward Island'] = true,
|
||||
['Quebec'] = true, ['Saskatchewan'] = true, ['Yukon'] = true},
|
||||
['Mexico'] = true,
|
||||
['Central America'] = true,
|
||||
['Europe'] = {['France'] = true, ['Germany'] = true, ['Spain'] = true, ['Italy'] = true, ['Poland'] = true, ['Switzerland'] = true,
|
||||
['Greece'] = true, ['Romania'] = true, ['Netherlands'] = true,
|
||||
['Great Britain'] = {['England'] = true, ['Scotland'] = true, ['Wales'] = true, ['Northern Ireland'] = true}
|
||||
},
|
||||
['Asia'] = { ['China'] = true, ['India'] = true, ['Japan'] = true, ['Korea'] = true, ['Russia'] = true, ['Vietnam'] = true},
|
||||
['South America'] = { ['Argentina'] = true, ['Brazil'] = true},
|
||||
['Africa'] = { ['Eygpt'] = true, ['Swaziland'] = true},
|
||||
['Australia'] = true, ['Middle East'] = true, ['Antarctica'] = true, ['New Zealand'] = true
|
||||
},
|
||||
['Age'] = {'/sc 6_10', true, ['Rugrat'] = true, ['Kid'] = true, ['Tween'] = true, ['Teen'] = true, ['Twenties'] = true,
|
||||
['Old'] = true, ['Ancient'] = true, ['Mesozoic'] = true, ['I don\'t want to say my age. Don\'t ask.'] = true},
|
||||
['Mood'] = {'/sc 6_11', true, ['Good'] = true, ['Great!'] = true, ['Not bad'] = true, ['Sad'] = true, ['Hyper'] = true,
|
||||
['Chill'] = true, ['Happy'] = true, ['Kind of mad'] = true},
|
||||
['Boy'] = {'/sc 6_12', true},
|
||||
['Girl'] = {'/sc 6_13', true},
|
||||
['I don\'t want to say boy or girl. Don\'t ask.'] = {'/sc 6_14', true},
|
||||
[1] = '/sc 6'
|
||||
},
|
||||
['Game'] = {
|
||||
['Let\'s build'] = {'/sc 7_0', true},
|
||||
['Let\'s battle'] = {'/sc 7_1', true},
|
||||
['Nice one!'] = {'/sc 7_2', true},
|
||||
['So far so good'] = {'/sc 7_3', true},
|
||||
['Lucky shot!'] = {'/sc 7_4', true},
|
||||
['Oh man!'] = {'/sc 7_5', true},
|
||||
['I challenge you to a fight!'] = {'/sc 7_6', true},
|
||||
['Help me with this'] = {'/sc 7_7', true},
|
||||
['Let\'s go to your game'] = {'/sc 7_8', true},
|
||||
['Can you show me how do to that?'] = {'/sc 7_9', true},
|
||||
['Backflip!'] = {'/sc 7_10', true},
|
||||
['Frontflip!'] = {'/sc 7_11', true},
|
||||
['Dance!'] = {'/sc 7_12', true},
|
||||
['I\'m on your side!'] = {'/sc 7_13', true},
|
||||
['Game Commands'] = {'/sc 7_14', true, ['regen'] = true, ['reset'] = true, ['go'] = true, ['fix'] = true, ['respawn'] = true},
|
||||
[1] = '/sc 7'
|
||||
};
|
||||
['Silly'] = {
|
||||
['Muahahahaha!'] = true,
|
||||
['all your base are belong to me!'] = true,
|
||||
['GET OFF MAH LAWN'] = true,
|
||||
['TEH EPIK DUCK IS COMING!!!'] = true,
|
||||
['ROFL'] = true,
|
||||
['1337'] = {true, ['i r teh pwnz0r!'] = true, ['w00t!'] = true, ['z0mg h4x!'] = true, ['ub3rR0xXorzage!'] = true}
|
||||
},
|
||||
['Yes'] = {
|
||||
['Absolutely!'] = true,
|
||||
['Rock on!'] = true,
|
||||
['Totally!'] = true,
|
||||
['Juice!'] = true,
|
||||
['Yay!'] = true,
|
||||
['Yesh'] = true
|
||||
},
|
||||
['No'] = {
|
||||
['Ummm. No.'] = true,
|
||||
['...'] = true,
|
||||
['Stop!'] = true,
|
||||
['Go away!'] = true,
|
||||
['Don\'t do that'] = true,
|
||||
['Stop breaking the rules'] = true,
|
||||
['I don\'t want to'] = true
|
||||
},
|
||||
['Ok'] = {
|
||||
['Well... ok'] = true,
|
||||
['Sure'] = true
|
||||
},
|
||||
['Uncertain'] = {
|
||||
['Maybe'] = true,
|
||||
['I don\'t know'] = true,
|
||||
['idk'] = true,
|
||||
['I can\'t decide'] = true,
|
||||
['Hmm...'] = true
|
||||
},
|
||||
[':-)'] = {
|
||||
[':-('] = true,
|
||||
[':D'] = true,
|
||||
[':-O'] = true,
|
||||
['lol'] = true,
|
||||
['=D'] = true,
|
||||
['D='] = true,
|
||||
['XD'] = true,
|
||||
[';D'] = true,
|
||||
[';)'] = true,
|
||||
['O_O'] = true,
|
||||
['=)'] = true,
|
||||
['@_@'] = true,
|
||||
['>_<'] = true,
|
||||
['T_T'] = true,
|
||||
['^_^'] = true,
|
||||
['<(0_0<) <(0_0)> (>0_0)> KIRBY DANCE'] = true,
|
||||
[')\';'] = true,
|
||||
[':3'] = true
|
||||
},
|
||||
['Ratings'] = {
|
||||
['Rate it!'] = true,
|
||||
['I give it a 1 out of 10'] = true,
|
||||
['I give it a 2 out of 10'] = true,
|
||||
['I give it a 3 out of 10'] = true,
|
||||
['I give it a 4 out of 10'] = true,
|
||||
['I give it a 5 out of 10'] = true,
|
||||
['I give it a 6 out of 10'] = true,
|
||||
['I give it a 7 out of 10'] = true,
|
||||
['I give it a 8 out of 10'] = true,
|
||||
['I give it a 9 out of 10'] = true,
|
||||
['I give it a 10 out of 10!'] = true,
|
||||
}
|
||||
},
|
||||
CreateEnum('SafeChat'){'Level1', 'Level2', 'Level3'},
|
||||
SafeChatTree = {}
|
||||
}
|
||||
---------------------------------------------------
|
||||
|
||||
|
||||
|
||||
-- Check if we are running on a touch device
|
||||
function Chat:IsTouchDevice()
|
||||
local touchEnabled = false
|
||||
pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end)
|
||||
return touchEnabled
|
||||
end
|
||||
|
||||
-- Scrolling
|
||||
function Chat:ScrollQueue(value)
|
||||
for i = 1, #self.MessageQueue do
|
||||
if self.MessageQueue[i] then
|
||||
for _, label in pairs(self.MessageQueue[i]) do
|
||||
local next = self.MessageQueue[i].Next
|
||||
local previous = self.MessageQueue[i].Previous
|
||||
if label and label:IsA('TextLabel') or label:IsA('TextButton') then
|
||||
if value > 0 and previous and previous['Message'] then
|
||||
label.Position = previous['Message'].Position
|
||||
elseif value < 1 and next['Message'] then
|
||||
label.Position = previous['Message'].Position
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function Chat:FocusOnChatBar()
|
||||
if self.ClickToChatButton then
|
||||
self.ClickToChatButton.Visible = false
|
||||
end
|
||||
|
||||
self.GotFocus = true
|
||||
if self.Frame['Background'] then
|
||||
self.Frame.Background.Visible = false
|
||||
end
|
||||
self.ChatBar:CaptureFocus()
|
||||
end
|
||||
|
||||
-- For touch devices we create a button instead
|
||||
function Chat:CreateTouchButton()
|
||||
self.ChatTouchFrame = Gui.Create'Frame'
|
||||
{
|
||||
Name = 'ChatTouchFrame';
|
||||
Size = UDim2.new(0, 128, 0, 32);
|
||||
Position = UDim2.new(0, 88, 0, 0);
|
||||
BackgroundTransparency = 1.0;
|
||||
Parent = self.Gui;
|
||||
|
||||
Gui.Create'ImageButton'
|
||||
{
|
||||
Name = 'ChatLabel';
|
||||
Size = UDim2.new(0, 74, 0, 28);
|
||||
Position = UDim2.new(0, 0, 0, 0);
|
||||
BackgroundTransparency = 1.0;
|
||||
ZIndex = 2.0;
|
||||
};
|
||||
|
||||
Gui.Create'ImageLabel'
|
||||
{
|
||||
Name = 'Background';
|
||||
Size = UDim2.new(1, 0, 1, 0);
|
||||
Position = UDim2.new(0, 0, 0, 0);
|
||||
BackgroundTransparency = 1.0;
|
||||
Image = 'http://www.roblox.com/asset/?id=97078724'
|
||||
};
|
||||
}
|
||||
self.TapToChatLabel = self.ChatTouchFrame.ChatLabel
|
||||
self.TouchLabelBackground = self.ChatTouchFrame.Background
|
||||
|
||||
self.ChatBar = Gui.Create'TextBox'
|
||||
{
|
||||
Name = 'ChatBar';
|
||||
Size = UDim2.new(1, 0, 0.2, 0);
|
||||
Position = UDim2.new(0, 0, 0.8, 0);
|
||||
Text = "";
|
||||
ZIndex = 1.0;
|
||||
BackgroundTransparency = 1.0;
|
||||
Parent = self.Frame;
|
||||
TextXAlignment = Enum.TextXAlignment.Left;
|
||||
TextColor3 = Color3.new(1, 1, 1);
|
||||
ClearTextOnFocus = false;
|
||||
};
|
||||
|
||||
self.TapToChatLabel.MouseButton1Click:connect(function()
|
||||
self.TapToChatLabel.Visible = false
|
||||
--self.ChatBar.Visible = true
|
||||
self.Frame.Background.Visible = true
|
||||
self.ChatBar:CaptureFocus()
|
||||
self.GotFocus = true
|
||||
if self.TouchLabelBackground then
|
||||
self.TouchLabelBackground.Visible = false
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- Non touch devices, create the bottom chat bar
|
||||
function Chat:CreateChatBar()
|
||||
-- okay now we do
|
||||
local status, result = pcall(function() return GuiService.UseLuaChat end)
|
||||
if status and result then
|
||||
self.ClickToChatButton = Gui.Create'TextButton'
|
||||
{
|
||||
Name = 'ClickToChat';
|
||||
Size = UDim2.new(1, 0, 0, 20);
|
||||
BackgroundTransparency = 1.0;
|
||||
ZIndex = 2.0;
|
||||
Parent = self.Gui;
|
||||
Text = "To chat click here or press \"/\" key";
|
||||
TextColor3 = Color3.new(1, 1, 0.9);
|
||||
Position = UDim2.new(0, 0, 1, 0);
|
||||
TextXAlignment = Enum.TextXAlignment.Left;
|
||||
FontSize = Enum.FontSize.Size12;
|
||||
}
|
||||
|
||||
self.ChatBar = Gui.Create'TextBox'
|
||||
{
|
||||
Name = 'ChatBar';
|
||||
Size = UDim2.new(1, 0, 0, 20);
|
||||
Position = UDim2.new(0, 0, 1, 0);
|
||||
Text = "";
|
||||
ZIndex = 1.0;
|
||||
BackgroundColor3 = Color3.new(0, 0, 0);
|
||||
BackgroundTransparency = 0.25;
|
||||
Parent = self.Gui;
|
||||
TextXAlignment = Enum.TextXAlignment.Left;
|
||||
TextColor3 = Color3.new(1, 1, 1);
|
||||
FontSize = Enum.FontSize.Size12;
|
||||
ClearTextOnFocus = false;
|
||||
Text = '';
|
||||
};
|
||||
|
||||
-- Engine has code to offset the entire world, so if we do it by -20 pixels nothing gets in our chat's way
|
||||
GuiService:SetGlobalSizeOffsetPixel(0, -20)
|
||||
-- CHatHotKey is '/'
|
||||
GuiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey)
|
||||
GuiService.SpecialKeyPressed:connect(function(key)
|
||||
if key == Enum.SpecialKey.ChatHotkey then
|
||||
Chat:FocusOnChatBar()
|
||||
end
|
||||
end)
|
||||
|
||||
self.ClickToChatButton.MouseButton1Click:connect(function()
|
||||
Chat:FocusOnChatBar()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
-- For scrolling, to see if we hit the bounds so that we can stop it from scrolling anymore
|
||||
function Chat:CheckIfInBounds(value)
|
||||
if #Chat.MessageQueue < 3 then
|
||||
return true
|
||||
end
|
||||
|
||||
if value > 0 and Chat.MessageQueue[1] and Chat.MessageQueue[1]['Player'] and Chat.MessageQueue[1]['Player'].Position.Y.Scale == 0 then
|
||||
return true
|
||||
elseif value < 0 and Chat.MessageQueue[1] and Chat.MessageQueue[1]['Player'] and Chat.MessageQueue[1]['Player'].Position.Y.Scale < 0 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- This is to precompute all playerName space strings
|
||||
-- This is used to offset the message by exactly this + 2 spacestrings
|
||||
function Chat:ComputeSpaceString(pLabel)
|
||||
local tLabel = Gui.Create'TextButton'
|
||||
{
|
||||
Size = UDim2.new(0, pLabel.AbsoluteSize.X, 0, pLabel.AbsoluteSize.Y);
|
||||
FontSize = self.Configuration.FontSize;
|
||||
Parent = self.RenderFrame;
|
||||
BackgroundTransparency = 1.0;
|
||||
Text = nString;
|
||||
};
|
||||
local nString = " "
|
||||
while tLabel.TextBounds.X < pLabel.TextBounds.X do
|
||||
nString = nString .. " "
|
||||
tLabel.Text = nString
|
||||
end
|
||||
self.CachedSpaceStrings_List[pLabel.Text] = nString
|
||||
return nString
|
||||
end
|
||||
|
||||
|
||||
|
||||
function Chat:ScreenSizeChanged()
|
||||
while self.Frame.AbsoluteSize.Y > 120 do
|
||||
self.Frame.Size = self.Frame.Size - UDim2.new(0, 0, 0.005, 0)
|
||||
end
|
||||
end
|
||||
|
||||
-- Create the initial Chat stuff
|
||||
-- Done only once
|
||||
function Chat:CreateGui()
|
||||
self.Gui = WaitForChild(CoreGuiService, 'RobloxGui')
|
||||
self.Frame = Gui.Create'Frame'
|
||||
{
|
||||
Name = 'ChatFrame';
|
||||
Size = self.Configuration.Size;
|
||||
Position = UDim2.new(0, 0, 0, 5);
|
||||
BackgroundTransparency = 1.0;
|
||||
--ClipsDescendants = true;
|
||||
ZIndex = 0.0;
|
||||
Parent = self.Gui;
|
||||
|
||||
Gui.Create'ImageLabel'
|
||||
{
|
||||
Name = 'Background';
|
||||
Image = 'http://www.roblox.com/asset/?id=97120937'; --96551212';
|
||||
Size = UDim2.new(1.3, 0, 1.64, 0);
|
||||
Position = UDim2.new(0, 0, 0, 0);
|
||||
BackgroundTransparency = 1.0;
|
||||
ZIndex = 0.0;
|
||||
Visible = false
|
||||
};
|
||||
|
||||
Gui.Create'Frame'
|
||||
{
|
||||
Name = 'Border';
|
||||
Size = UDim2.new(1, 0, 0, 1);
|
||||
Position = UDim2.new(0, 0, 0.8, 0);
|
||||
BackgroundTransparency = 0.0;
|
||||
BackgroundColor3 = Color3.new(236/255, 236/255, 236/255);
|
||||
BorderSizePixel = 0.0;
|
||||
Visible = false;
|
||||
};
|
||||
|
||||
Gui.Create'Frame'
|
||||
{
|
||||
Name = 'ChatRenderFrame';
|
||||
Size = UDim2.new(1.02, 0, 1.01, 0);
|
||||
Position = UDim2.new(0, 0, 0, 0);
|
||||
BackgroundTransparency = 1.0;
|
||||
ClipsDescendants = true;
|
||||
ZIndex = 0.0;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
self.RenderFrame = self.Frame.ChatRenderFrame
|
||||
if Chat:IsTouchDevice() then
|
||||
self.Frame.Position = self.Configuration.Position;
|
||||
self.RenderFrame.Size = UDim2.new(1, 0, 1, 0)
|
||||
elseif self.Frame.AbsoluteSize.Y > 120 then
|
||||
Chat:ScreenSizeChanged()
|
||||
self.Gui.Changed:connect(function(property)
|
||||
if property == 'AbsoluteSize' then
|
||||
Chat:ScreenSizeChanged()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if Player.ChatMode == Enum.ChatMode.TextAndMenu then
|
||||
if Chat:IsTouchDevice() then
|
||||
Chat:CreateTouchButton()
|
||||
else
|
||||
Chat:CreateChatBar()
|
||||
--Chat:CreateSafeChatGui()
|
||||
end
|
||||
|
||||
if self.ChatBar then
|
||||
self.ChatBar.FocusLost:connect(function(enterPressed)
|
||||
Chat.GotFocus = false
|
||||
if Chat:IsTouchDevice() then
|
||||
self.ChatBar.Visible = false
|
||||
self.TapToChatLabel.Visible = true
|
||||
|
||||
if self.TouchLabelBackground then
|
||||
self.TouchLabelBackground.Visible = true
|
||||
end
|
||||
end
|
||||
if enterPressed and self.ChatBar.Text ~= "" then
|
||||
if PlayersService.ClassicChat then
|
||||
pcall(function() PlayersService:Chat(self.ChatBar.Text) end)
|
||||
elseif PlayersService.BubbleChat then
|
||||
-- do nothing
|
||||
end
|
||||
if self.ClickToChatButton then
|
||||
self.ClickToChatButton.Visible = true
|
||||
end
|
||||
self.ChatBar.Text = ""
|
||||
end
|
||||
Spawn(function()
|
||||
wait(5.0)
|
||||
if not Chat.GotFocus then
|
||||
Chat.Frame.Background.Visible = false
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Chat:FindButtonTree(scButton, rootList)
|
||||
local list = {}
|
||||
rootList = rootList or self.SafeChatTree
|
||||
for button, _ in pairs(rootList) do
|
||||
if button == scButton then
|
||||
list = rootList[button]
|
||||
elseif type(rootList[button]) == 'table' then
|
||||
list = Chat:FindButtonTree(scButton, rootList[button])
|
||||
end
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
function Chat:ToggleSafeChatMenu(scButton)
|
||||
local list = Chat:FindButtonTree(scButton, self.SafeChatTree)
|
||||
if list then
|
||||
for button, _ in pairs(list) do
|
||||
if button:IsA('TextButton') or button:IsA('ImageButton') then
|
||||
button.Visible = not button.Visible
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function Chat:CreateSafeChatOptions(list, rootButton)
|
||||
local text_List = {}
|
||||
level = level or 0
|
||||
local count = 0
|
||||
text_List[rootButton] = {}
|
||||
text_List[rootButton][1] = list[1]
|
||||
rootButton = rootButton or self.SafeChatButton
|
||||
for msg, _ in pairs(list) do
|
||||
if type(msg) == 'string' then
|
||||
local chatText = Gui.Create'TextButton'
|
||||
{
|
||||
Name = msg;
|
||||
Text = msg;
|
||||
Size = UDim2.new(0, 100, 0, 20);
|
||||
TextXAlignment = Enum.TextXAlignment.Center;
|
||||
TextColor3 = Color3.new(0.2, 0.1, 0.1);
|
||||
BackgroundTransparency = 0.5;
|
||||
BackgroundColor3 = Color3.new(1, 1, 1);
|
||||
Parent = self.SafeChatFrame;
|
||||
Visible = false;
|
||||
Position = UDim2.new(0, rootButton.Position.X.Scale + 105, 0, rootButton.Position.Y.Scale - ((count - 3) * 100));
|
||||
};
|
||||
|
||||
count = count + 1
|
||||
|
||||
if type(list[msg]) == 'table' then
|
||||
text_List[rootButton][chatText] = Chat:CreateSafeChatOptions(list[msg], chatText)
|
||||
else
|
||||
--table.insert(text_List[chatText], true)
|
||||
end
|
||||
chatText.MouseEnter:connect(function()
|
||||
Chat:ToggleSafeChatMenu(chatText)
|
||||
end)
|
||||
|
||||
chatText.MouseLeave:connect(function()
|
||||
Chat:ToggleSafeChatMenu(chatText)
|
||||
end)
|
||||
|
||||
chatText.MouseButton1Click:connect(function()
|
||||
local lList = Chat:FindButtonTree(chatText)
|
||||
if lList then
|
||||
for i, v in pairs(lList) do
|
||||
end
|
||||
else
|
||||
end
|
||||
pcall(function() PlayersService:Chat(lList[1]) end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
return text_List
|
||||
end
|
||||
|
||||
function Chat:CreateSafeChatGui()
|
||||
self.SafeChatFrame = Gui.Create'Frame'
|
||||
{
|
||||
Name = 'SafeChatFrame';
|
||||
Size = UDim2.new(1, 0, 1, 0);
|
||||
Parent = self.Gui;
|
||||
BackgroundTransparency = 1.0;
|
||||
|
||||
Gui.Create'ImageButton'
|
||||
{
|
||||
Name = 'SafeChatButton';
|
||||
Size = UDim2.new(0, 44, 0, 31);
|
||||
Position = UDim2.new(0, 1, 0.35, 0);
|
||||
BackgroundTransparency = 1.0;
|
||||
Image = 'http://www.roblox.com/asset/?id=97080365';
|
||||
};
|
||||
}
|
||||
|
||||
self.SafeChatButton = self.SafeChatFrame.SafeChatButton
|
||||
-- safe chat button is the root of this tree
|
||||
self.SafeChatTree[self.SafeChatButton] = Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton)
|
||||
|
||||
self.SafeChatButton.MouseButton1Click:connect(function()
|
||||
Chat:ToggleSafeChatMenu(self.SafeChatButton)
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
-- Scrolling function
|
||||
-- Applies a speed(velocity) to have nice scrolling effect
|
||||
function Input:OnMouseScroll()
|
||||
Spawn(function()
|
||||
-- How long should the speed last?
|
||||
while Input.Speed ~=0 do
|
||||
if Input.Speed > 1 then
|
||||
while Input.Speed > 0 do
|
||||
Input.Speed = Input.Speed - 1
|
||||
wait(0.25)
|
||||
end
|
||||
elseif Input.Speed < 0 then
|
||||
while Input.Speed < 0 do
|
||||
Input.Speed = Input.Speed + 1
|
||||
wait(0.25)
|
||||
end
|
||||
end
|
||||
wait()
|
||||
end
|
||||
end)
|
||||
if Chat:CheckIfInBounds(Input.Speed) then
|
||||
return
|
||||
end
|
||||
Chat:ScrollQueue()
|
||||
end
|
||||
|
||||
function Input:ApplySpeed(value)
|
||||
Input.Speed = Input.Speed + value
|
||||
if not self.Simulating then
|
||||
Input:OnMouseScroll()
|
||||
end
|
||||
end
|
||||
|
||||
function Input:Initialize()
|
||||
self.Mouse.WheelBackward:connect(function()
|
||||
Input:ApplySpeed(self.Configuration.DefaultSpeed)
|
||||
end)
|
||||
|
||||
self.Mouse.WheelForward:connect(function()
|
||||
Input:ApplySpeed(self.Configuration.DefaultSpeed)
|
||||
end)
|
||||
end
|
||||
|
||||
function Chat:FindMessageInSafeChat(message, list)
|
||||
local foundMessage = false
|
||||
for msg, _ in pairs(list) do
|
||||
if msg == message then
|
||||
return true
|
||||
end
|
||||
if type(list[msg]) == 'table' then
|
||||
foundMessage = Chat:FindMessageInSafeChat(message, list[msg])
|
||||
if foundMessage then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return foundMessage
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- RobloxLock everything so users can't delete them(?)
|
||||
function Chat:LockAllFields(gui)
|
||||
local children = gui:GetChildren()
|
||||
for i = 1, #children do
|
||||
children[i].RobloxLocked = true
|
||||
if #children[i]:GetChildren() > 0 then
|
||||
Chat:LockAllFields(children[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Constructor
|
||||
-- This function initializes everything
|
||||
function Chat:Initialize()
|
||||
Chat:CreateGui()
|
||||
self.EventListener = PlayersService.PlayerChatted:connect(function(...)
|
||||
-- This event has 4 callback arguments
|
||||
-- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer
|
||||
Chat:PlayerChatted(...)
|
||||
|
||||
end)
|
||||
|
||||
-- Initialize input for us
|
||||
Input:Initialize()
|
||||
-- Eww, everytime a player is added, you have to redo the connection
|
||||
-- Seems this is not automatic
|
||||
Game.Players.ChildAdded:connect(function()
|
||||
Chat.EventListener:disconnect()
|
||||
self.EventListener = PlayersService.PlayerChatted:connect(function(...)
|
||||
-- This event has 4 callback arguments
|
||||
-- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer
|
||||
Chat:PlayerChatted(...)
|
||||
end)
|
||||
end)
|
||||
|
||||
Spawn(function()
|
||||
Chat:CullThread()
|
||||
end)
|
||||
|
||||
self.Frame.RobloxLocked = true
|
||||
Chat:LockAllFields(self.Frame)
|
||||
self.Frame.DescendantAdded:connect(function(descendant)
|
||||
Chat:LockAllFields(descendant)
|
||||
end)
|
||||
end
|
||||
|
||||
Chat:Initialize()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
3862
public/asset/11
3862
public/asset/11
File diff suppressed because it is too large
Load Diff
1549
public/asset/12
1549
public/asset/12
File diff suppressed because it is too large
Load Diff
3398
public/asset/13
3398
public/asset/13
File diff suppressed because it is too large
Load Diff
871
public/asset/14
871
public/asset/14
|
|
@ -1,863 +1,24 @@
|
|||
%14%
|
||||
-- A couple of necessary functions
|
||||
local function waitForChild(instance, name)
|
||||
assert(instance)
|
||||
assert(name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
print('Waiting for ...', instance, name)
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
return instance:FindFirstChild(name)
|
||||
end
|
||||
local function waitForProperty(instance, property)
|
||||
assert(instance)
|
||||
assert(property)
|
||||
while not instance[property] do
|
||||
instance.Changed:wait()
|
||||
end
|
||||
end
|
||||
local t = {}
|
||||
|
||||
local function IsTouchDevice()
|
||||
local touchEnabled = false
|
||||
pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end)
|
||||
return touchEnabled
|
||||
end
|
||||
|
||||
|
||||
waitForChild(game,"Players")
|
||||
waitForProperty(game.Players,"LocalPlayer")
|
||||
local player = game.Players.LocalPlayer
|
||||
|
||||
local RbxGui, msg = LoadLibrary("RbxGui")
|
||||
if not RbxGui then print("could not find RbxGui!") return end
|
||||
|
||||
--- Begin Locals
|
||||
local StaticTabName = "gear"
|
||||
|
||||
local backpack = script.Parent
|
||||
local screen = script.Parent.Parent
|
||||
|
||||
local backpackItems = {}
|
||||
local buttons = {}
|
||||
|
||||
local debounce = false
|
||||
local browsingMenu = false
|
||||
|
||||
local mouseEnterCons = {}
|
||||
local mouseClickCons = {}
|
||||
|
||||
local characterChildAddedCon = nil
|
||||
local characterChildRemovedCon = nil
|
||||
local backpackAddCon = nil
|
||||
|
||||
local playerBackpack = waitForChild(player,"Backpack")
|
||||
|
||||
waitForChild(backpack,"Tabs")
|
||||
|
||||
waitForChild(backpack,"Gear")
|
||||
local gearPreview = waitForChild(backpack.Gear,"GearPreview")
|
||||
|
||||
local scroller = waitForChild(backpack.Gear,"GearGridScrollingArea")
|
||||
|
||||
local currentLoadout = waitForChild(backpack.Parent,"CurrentLoadout")
|
||||
|
||||
local grid = waitForChild(backpack.Gear,"GearGrid")
|
||||
local gearButton = waitForChild(grid,"GearButton")
|
||||
|
||||
local swapSlot = waitForChild(script.Parent,"SwapSlot")
|
||||
|
||||
local backpackManager = waitForChild(script.Parent,"CoreScripts/BackpackScripts/BackpackManager")
|
||||
local backpackOpenEvent = waitForChild(backpackManager,"BackpackOpenEvent")
|
||||
local backpackCloseEvent = waitForChild(backpackManager,"BackpackCloseEvent")
|
||||
local tabClickedEvent = waitForChild(backpackManager,"TabClickedEvent")
|
||||
local resizeEvent = waitForChild(backpackManager,"ResizeEvent")
|
||||
local searchRequestedEvent = waitForChild(backpackManager,"SearchRequestedEvent")
|
||||
local tellBackpackReadyFunc = waitForChild(backpackManager,"BackpackReady")
|
||||
|
||||
-- creating scroll bar early as to make sure items get placed correctly
|
||||
local scrollFrame, scrollUp, scrollDown, recalculateScroll = RbxGui.CreateScrollingFrame(nil, "grid", Vector2.new(6, 6))
|
||||
|
||||
scrollFrame.Position = UDim2.new(0,0,0,30)
|
||||
scrollFrame.Size = UDim2.new(1,0,1,-30)
|
||||
scrollFrame.Parent = backpack.Gear.GearGrid
|
||||
|
||||
local scrollBar = Instance.new("Frame")
|
||||
scrollBar.Name = "ScrollBar"
|
||||
scrollBar.BackgroundTransparency = 0.9
|
||||
scrollBar.BackgroundColor3 = Color3.new(1,1,1)
|
||||
scrollBar.BorderSizePixel = 0
|
||||
scrollBar.Size = UDim2.new(0, 17, 1, -36)
|
||||
scrollBar.Position = UDim2.new(0,0,0,18)
|
||||
scrollBar.Parent = scroller
|
||||
|
||||
scrollDown.Position = UDim2.new(0,0,1,-17)
|
||||
|
||||
scrollUp.Parent = scroller
|
||||
scrollDown.Parent = scroller
|
||||
|
||||
local scrollFrameLoadout, scrollUpLoadout, scrollDownLoadout, recalculateScrollLoadout = RbxGui.CreateScrollingFrame()
|
||||
|
||||
scrollFrameLoadout.Position = UDim2.new(0,0,0,0)
|
||||
scrollFrameLoadout.Size = UDim2.new(1,0,1,0)
|
||||
scrollFrameLoadout.Parent = backpack.Gear.GearLoadouts.LoadoutsList
|
||||
|
||||
local LoadoutButton = Instance.new("TextButton")
|
||||
LoadoutButton.RobloxLocked = true
|
||||
LoadoutButton.Name = "LoadoutButton"
|
||||
LoadoutButton.Font = Enum.Font.ArialBold
|
||||
LoadoutButton.FontSize = Enum.FontSize.Size14
|
||||
LoadoutButton.Position = UDim2.new(0,0,0,0)
|
||||
LoadoutButton.Size = UDim2.new(1,0,0,32)
|
||||
LoadoutButton.Style = Enum.ButtonStyle.RobloxButton
|
||||
LoadoutButton.Text = "Loadout #1"
|
||||
LoadoutButton.TextColor3 = Color3.new(1,1,1)
|
||||
LoadoutButton.Parent = scrollFrameLoadout
|
||||
|
||||
local LoadoutButtonTwo = LoadoutButton:clone()
|
||||
LoadoutButtonTwo.Text = "Loadout #2"
|
||||
LoadoutButtonTwo.Parent = scrollFrameLoadout
|
||||
|
||||
local LoadoutButtonThree = LoadoutButton:clone()
|
||||
LoadoutButtonThree.Text = "Loadout #3"
|
||||
LoadoutButtonThree.Parent = scrollFrameLoadout
|
||||
|
||||
local LoadoutButtonFour = LoadoutButton:clone()
|
||||
LoadoutButtonFour.Text = "Loadout #4"
|
||||
LoadoutButtonFour.Parent = scrollFrameLoadout
|
||||
|
||||
local scrollBarLoadout = Instance.new("Frame")
|
||||
scrollBarLoadout.Name = "ScrollBarLoadout"
|
||||
scrollBarLoadout.BackgroundTransparency = 0.9
|
||||
scrollBarLoadout.BackgroundColor3 = Color3.new(1,1,1)
|
||||
scrollBarLoadout.BorderSizePixel = 0
|
||||
scrollBarLoadout.Size = UDim2.new(0, 17, 1, -36)
|
||||
scrollBarLoadout.Position = UDim2.new(0,0,0,18)
|
||||
scrollBarLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
|
||||
|
||||
scrollDownLoadout.Position = UDim2.new(0,0,1,-17)
|
||||
|
||||
scrollUpLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
|
||||
scrollDownLoadout.Parent = backpack.Gear.GearLoadouts.GearLoadoutsScrollingArea
|
||||
|
||||
|
||||
-- Begin Functions
|
||||
function removeFromMap(map,object)
|
||||
for i = 1, #map do
|
||||
if map[i] == object then
|
||||
table.remove(map,i)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function robloxLock(instance)
|
||||
instance.RobloxLocked = true
|
||||
children = instance:GetChildren()
|
||||
if children then
|
||||
for i, child in ipairs(children) do
|
||||
robloxLock(child)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function resize()
|
||||
local size = 0
|
||||
if gearPreview.AbsoluteSize.Y > gearPreview.AbsoluteSize.X then
|
||||
size = gearPreview.AbsoluteSize.X * 0.75
|
||||
else
|
||||
size = gearPreview.AbsoluteSize.Y * 0.75
|
||||
t.Foo =
|
||||
function()
|
||||
print("foo")
|
||||
end
|
||||
|
||||
waitForChild(gearPreview,"GearImage")
|
||||
gearPreview.GearImage.Size = UDim2.new(0,size,0,size)
|
||||
gearPreview.GearImage.Position = UDim2.new(0,gearPreview.AbsoluteSize.X/2 - size/2,0.75,-size)
|
||||
|
||||
resizeGrid()
|
||||
end
|
||||
|
||||
function addToGrid(child)
|
||||
if not child:IsA("Tool") then
|
||||
if not child:IsA("HopperBin") then
|
||||
return
|
||||
end
|
||||
end
|
||||
if child:FindFirstChild("RobloxBuildTool") then return end
|
||||
|
||||
for i,v in pairs(backpackItems) do -- check to see if we already have this gear registered
|
||||
if v == child then return end
|
||||
t.Bar =
|
||||
function()
|
||||
print("bar")
|
||||
end
|
||||
|
||||
table.insert(backpackItems,child)
|
||||
|
||||
local changeCon = child.Changed:connect(function(prop)
|
||||
if prop == "Name" then
|
||||
if buttons[child] then
|
||||
if buttons[child].Image == "" then
|
||||
buttons[child].GearText.Text = child.Name
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
local ancestryCon = nil
|
||||
ancestryCon = child.AncestryChanged:connect(function(theChild,theParent)
|
||||
local thisObject = nil
|
||||
for k,v in pairs(backpackItems) do
|
||||
if v == child then
|
||||
thisObject = v
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
waitForProperty(player,"Character")
|
||||
waitForChild(player,"Backpack")
|
||||
if (child.Parent ~= player.Backpack and child.Parent ~= player.Character) then
|
||||
if ancestryCon then ancestryCon:disconnect() end
|
||||
if changeCon then changeCon:disconnect() end
|
||||
|
||||
for k,v in pairs(backpackItems) do
|
||||
if v == thisObject then
|
||||
if mouseEnterCons[buttons[v]] then mouseEnterCons[buttons[v]]:disconnect() end
|
||||
if mouseClickCons[buttons[v]] then mouseClickCons[buttons[v]]:disconnect() end
|
||||
buttons[v].Parent = nil
|
||||
buttons[v] = nil
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
removeFromMap(backpackItems,thisObject)
|
||||
|
||||
resizeGrid()
|
||||
else
|
||||
resizeGrid()
|
||||
end
|
||||
updateGridActive()
|
||||
end)
|
||||
resizeGrid()
|
||||
end
|
||||
|
||||
function buttonClick(button)
|
||||
if button:FindFirstChild("UnequipContextMenu") and not button.Active then
|
||||
button.UnequipContextMenu.Visible = true
|
||||
browsingMenu = true
|
||||
end
|
||||
end
|
||||
|
||||
function previewGear(button)
|
||||
if not browsingMenu then
|
||||
gearPreview.Visible = false
|
||||
gearPreview.GearImage.Image = button.Image
|
||||
gearPreview.GearStats.GearName.Text = button.GearReference.Value.Name
|
||||
end
|
||||
end
|
||||
|
||||
function findEmptySlot()
|
||||
local smallestNum = nil
|
||||
local loadout = currentLoadout:GetChildren()
|
||||
for i = 1, #loadout do
|
||||
if loadout[i]:IsA("Frame") and #loadout[i]:GetChildren() <= 0 then
|
||||
local frameNum = tonumber(string.sub(loadout[i].Name,5))
|
||||
if frameNum == 0 then frameNum = 10 end
|
||||
if not smallestNum or (smallestNum > frameNum) then
|
||||
smallestNum = frameNum
|
||||
end
|
||||
end
|
||||
end
|
||||
if smallestNum == 10 then smallestNum = 0 end
|
||||
return smallestNum
|
||||
end
|
||||
|
||||
function checkForSwap(button,x,y)
|
||||
local loadoutChildren = currentLoadout:GetChildren()
|
||||
for i = 1, #loadoutChildren do
|
||||
if loadoutChildren[i]:IsA("Frame") and string.find(loadoutChildren[i].Name,"Slot") then
|
||||
if x >= loadoutChildren[i].AbsolutePosition.x and x <= (loadoutChildren[i].AbsolutePosition.x + loadoutChildren[i].AbsoluteSize.x) then
|
||||
if y >= loadoutChildren[i].AbsolutePosition.y and y <= (loadoutChildren[i].AbsolutePosition.y + loadoutChildren[i].AbsoluteSize.y) then
|
||||
local slot = tonumber(string.sub(loadoutChildren[i].Name,5))
|
||||
swapGearSlot(slot,button)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function resizeGrid()
|
||||
for k,v in pairs(backpackItems) do
|
||||
if not v:FindFirstChild("RobloxBuildTool") then
|
||||
if not buttons[v] then
|
||||
local buttonClone = gearButton:clone()
|
||||
buttonClone.Parent = grid.ScrollingFrame
|
||||
buttonClone.Visible = true
|
||||
buttonClone.Image = v.TextureId
|
||||
if buttonClone.Image == "" then
|
||||
buttonClone.GearText.Text = v.Name
|
||||
end
|
||||
|
||||
buttonClone.GearReference.Value = v
|
||||
buttonClone.Draggable = true
|
||||
buttons[v] = buttonClone
|
||||
|
||||
|
||||
if not IsTouchDevice() then
|
||||
local unequipMenu = getGearContextMenu()
|
||||
|
||||
|
||||
unequipMenu.Visible = false
|
||||
unequipMenu.Parent = buttonClone
|
||||
end
|
||||
|
||||
local beginPos = nil
|
||||
buttonClone.DragBegin:connect(function(value)
|
||||
waitForChild(buttonClone, 'Background')
|
||||
buttonClone['Background'].ZIndex = 10
|
||||
buttonClone.ZIndex = 10
|
||||
beginPos = value
|
||||
end)
|
||||
buttonClone.DragStopped:connect(function(x,y)
|
||||
waitForChild(buttonClone, 'Background')
|
||||
buttonClone['Background'].ZIndex = 1.0
|
||||
buttonClone.ZIndex = 2
|
||||
if beginPos ~= buttonClone.Position then
|
||||
if not checkForSwap(buttonClone,x,y) then
|
||||
buttonClone:TweenPosition(beginPos,Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
|
||||
buttonClone.Draggable = false
|
||||
delay(0.5,function()
|
||||
buttonClone.Draggable = true
|
||||
end)
|
||||
else
|
||||
buttonClone.Position = beginPos
|
||||
end
|
||||
end
|
||||
end)
|
||||
local clickTime = tick()
|
||||
mouseEnterCons[buttonClone] = buttonClone.MouseEnter:connect(function() previewGear(buttonClone) end)
|
||||
mouseClickCons[buttonClone] = buttonClone.MouseButton1Click:connect(function()
|
||||
local newClickTime = tick()
|
||||
if buttonClone.Active and (newClickTime - clickTime) < 0.5 then
|
||||
local slot = findEmptySlot()
|
||||
if slot then
|
||||
buttonClone.ZIndex = 1
|
||||
swapGearSlot(slot,buttonClone)
|
||||
end
|
||||
else
|
||||
buttonClick(buttonClone)
|
||||
end
|
||||
clickTime = newClickTime
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
recalculateScroll()
|
||||
end
|
||||
|
||||
function showPartialGrid(subset)
|
||||
for k,v in pairs(buttons) do
|
||||
v.Parent = nil
|
||||
end
|
||||
if subset then
|
||||
for k,v in pairs(subset) do
|
||||
v.Parent = grid.ScrollingFrame
|
||||
end
|
||||
end
|
||||
recalculateScroll()
|
||||
end
|
||||
|
||||
function showEntireGrid()
|
||||
for k,v in pairs(buttons) do
|
||||
v.Parent = grid.ScrollingFrame
|
||||
end
|
||||
recalculateScroll()
|
||||
end
|
||||
|
||||
function inLoadout(gear)
|
||||
local children = currentLoadout:GetChildren()
|
||||
for i = 1, #children do
|
||||
if children[i]:IsA("Frame") then
|
||||
local button = children[i]:GetChildren()
|
||||
if #button > 0 then
|
||||
if button[1].GearReference.Value and button[1].GearReference.Value == gear then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function updateGridActive()
|
||||
for k,v in pairs(backpackItems) do
|
||||
if buttons[v] then
|
||||
local gear = nil
|
||||
local gearRef = buttons[v]:FindFirstChild("GearReference")
|
||||
|
||||
if gearRef then gear = gearRef.Value end
|
||||
|
||||
if not gear then
|
||||
buttons[v].Active = false
|
||||
elseif inLoadout(gear) then
|
||||
buttons[v].Active = false
|
||||
else
|
||||
buttons[v].Active = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function centerGear(loadoutChildren)
|
||||
local gearButtons = {}
|
||||
local lastSlotAdd = nil
|
||||
for i = 1, #loadoutChildren do
|
||||
if loadoutChildren[i]:IsA("Frame") and #loadoutChildren[i]:GetChildren() > 0 then
|
||||
if loadoutChildren[i].Name == "Slot0" then
|
||||
lastSlotAdd = loadoutChildren[i]
|
||||
else
|
||||
table.insert(gearButtons, loadoutChildren[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
if lastSlotAdd then table.insert(gearButtons,lastSlotAdd) end
|
||||
|
||||
local startPos = ( 1 - (#gearButtons * 0.1) ) / 2
|
||||
for i = 1, #gearButtons do
|
||||
gearButtons[i]:TweenPosition(UDim2.new(startPos + ((i - 1) * 0.1),0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
|
||||
end
|
||||
end
|
||||
|
||||
function tabClickHandler(tabName)
|
||||
if tabName == StaticTabName then
|
||||
backpackOpenHandler(tabName)
|
||||
else
|
||||
backpackCloseHandler(tabName)
|
||||
end
|
||||
end
|
||||
|
||||
function backpackOpenHandler(currentTab)
|
||||
if currentTab and currentTab ~= StaticTabName then
|
||||
backpack.Gear.Visible = false
|
||||
return
|
||||
end
|
||||
|
||||
backpack.Gear.Visible = true
|
||||
updateGridActive()
|
||||
|
||||
resizeGrid()
|
||||
resize()
|
||||
tellBackpackReadyFunc:Invoke()
|
||||
end
|
||||
|
||||
function backpackCloseHandler(currentTab)
|
||||
if currentTab and currentTab ~= StaticTabName then
|
||||
backpack.Gear.Visible = false
|
||||
return
|
||||
end
|
||||
|
||||
backpack.Gear.Visible = false
|
||||
|
||||
resizeGrid()
|
||||
resize()
|
||||
tellBackpackReadyFunc:Invoke()
|
||||
end
|
||||
|
||||
function loadoutCheck(child, selectState)
|
||||
if not child:IsA("ImageButton") then return end
|
||||
for k,v in pairs(backpackItems) do
|
||||
if buttons[v] then
|
||||
if child:FindFirstChild("GearReference") and buttons[v]:FindFirstChild("GearReference") then
|
||||
if buttons[v].GearReference.Value == child.GearReference.Value then
|
||||
buttons[v].Active = selectState
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function clearPreview()
|
||||
gearPreview.GearImage.Image = ""
|
||||
gearPreview.GearStats.GearName.Text = ""
|
||||
end
|
||||
|
||||
function removeAllEquippedGear(physGear)
|
||||
local stuff = player.Character:GetChildren()
|
||||
for i = 1, #stuff do
|
||||
if ( stuff[i]:IsA("Tool") or stuff[i]:IsA("HopperBin") ) and stuff[i] ~= physGear then
|
||||
stuff[i].Parent = playerBackpack
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function equipGear(physGear)
|
||||
removeAllEquippedGear(physGear)
|
||||
physGear.Parent = player.Character
|
||||
updateGridActive()
|
||||
end
|
||||
|
||||
function unequipGear(physGear)
|
||||
physGear.Parent = playerBackpack
|
||||
updateGridActive()
|
||||
end
|
||||
|
||||
function highlight(button)
|
||||
button.TextColor3 = Color3.new(0,0,0)
|
||||
button.BackgroundColor3 = Color3.new(0.8,0.8,0.8)
|
||||
end
|
||||
function clearHighlight(button)
|
||||
button.TextColor3 = Color3.new(1,1,1)
|
||||
button.BackgroundColor3 = Color3.new(0,0,0)
|
||||
end
|
||||
|
||||
function swapGearSlot(slot,gearButton)
|
||||
if not swapSlot.Value then -- signal loadout to swap a gear out
|
||||
swapSlot.Slot.Value = slot
|
||||
swapSlot.GearButton.Value = gearButton
|
||||
swapSlot.Value = true
|
||||
updateGridActive()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local UnequipGearMenuClick = function(element, menu)
|
||||
if type(element.Action) ~= "number" then return end
|
||||
local num = element.Action
|
||||
if num == 1 then -- remove from loadout
|
||||
unequipGear(menu.Parent.GearReference.Value)
|
||||
local inventoryButton = menu.Parent
|
||||
local gearToUnequip = inventoryButton.GearReference.Value
|
||||
local loadoutChildren = currentLoadout:GetChildren()
|
||||
local slot = -1
|
||||
for i = 1, #loadoutChildren do
|
||||
if loadoutChildren[i]:IsA("Frame") then
|
||||
local button = loadoutChildren[i]:GetChildren()
|
||||
if button[1] and button[1].GearReference.Value == gearToUnequip then
|
||||
slot = button[1].SlotNumber.Text
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
swapGearSlot(slot,nil)
|
||||
end
|
||||
end
|
||||
|
||||
function setupCharacterConnections()
|
||||
|
||||
if backpackAddCon then backpackAddCon:disconnect() end
|
||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) addToGrid(child) end)
|
||||
|
||||
-- make sure we get all the children
|
||||
local backpackChildren = game.Players.LocalPlayer.Backpack:GetChildren()
|
||||
for i = 1, #backpackChildren do
|
||||
addToGrid(backpackChildren[i])
|
||||
t.Help =
|
||||
function(funcNameOrFunc)
|
||||
--input argument can be a string or a function. Should return a description (of arguments and expected side effects)
|
||||
if funcNameOrFunc == "Foo" or funcNameOrFunc == t.Foo then
|
||||
return "Function Foo. Arguments: None. Side effect: prints foo"
|
||||
elseif funcNameOrFunc == "Bar" or funcNameOrFunc == t.Bar then
|
||||
return "Function Bar. Arguments: None. Side effect: prints bar"
|
||||
end
|
||||
end
|
||||
|
||||
if characterChildAddedCon then characterChildAddedCon:disconnect() end
|
||||
characterChildAddedCon =
|
||||
game.Players.LocalPlayer.Character.ChildAdded:connect(function(child)
|
||||
addToGrid(child)
|
||||
updateGridActive()
|
||||
end)
|
||||
|
||||
if characterChildRemovedCon then characterChildRemovedCon:disconnect() end
|
||||
characterChildRemovedCon =
|
||||
game.Players.LocalPlayer.Character.ChildRemoved:connect(function(child)
|
||||
updateGridActive()
|
||||
end)
|
||||
|
||||
wait()
|
||||
centerGear(currentLoadout:GetChildren())
|
||||
end
|
||||
|
||||
function removeCharacterConnections()
|
||||
if characterChildAddedCon then characterChildAddedCon:disconnect() end
|
||||
if characterChildRemovedCon then characterChildRemovedCon:disconnect() end
|
||||
if backpackAddCon then backpackAddCon:disconnect() end
|
||||
end
|
||||
|
||||
function trim(s)
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
function filterGear(terms)
|
||||
local filteredGear = {}
|
||||
for k,v in pairs(backpackItems) do
|
||||
if buttons[v] then
|
||||
local gearString = string.lower(buttons[v].GearReference.Value.Name)
|
||||
gearString = trim(gearString)
|
||||
for i = 1, #terms do
|
||||
if string.match(gearString,terms[i]) then
|
||||
table.insert(filteredGear,buttons[v])
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return filteredGear
|
||||
end
|
||||
function splitByWhitespace(text)
|
||||
if type(text) ~= "string" then return nil end
|
||||
|
||||
local terms = {}
|
||||
for token in string.gmatch(text, "[^%s]+") do
|
||||
if string.len(token) > 0 then
|
||||
table.insert(terms,token)
|
||||
end
|
||||
end
|
||||
return terms
|
||||
end
|
||||
function showSearchGear(searchTerms)
|
||||
if not backpack.Gear.Visible then return end -- currently not active tab
|
||||
|
||||
local searchTermTable = splitByWhitespace(searchTerms)
|
||||
if searchTermTable and (#searchTermTable > 0) then
|
||||
currSearchTerms = searchTermTable
|
||||
else
|
||||
currSearchTerms = nil
|
||||
end
|
||||
|
||||
if searchTermTable == nil then
|
||||
showEntireGrid()
|
||||
return
|
||||
end
|
||||
|
||||
local filteredButtons = filterGear(currSearchTerms)
|
||||
showPartialGrid(filteredButtons)
|
||||
end
|
||||
|
||||
function nukeBackpack()
|
||||
while #buttons > 0 do
|
||||
table.remove(buttons)
|
||||
end
|
||||
buttons = {}
|
||||
while #backpackItems > 0 do
|
||||
table.remove(backpackItems)
|
||||
end
|
||||
backpackItems = {}
|
||||
local scrollingFrameChildren = grid.ScrollingFrame:GetChildren()
|
||||
for i = 1, #scrollingFrameChildren do
|
||||
scrollingFrameChildren[i]:remove()
|
||||
end
|
||||
end
|
||||
|
||||
function getGearContextMenu()
|
||||
local gearContextMenu = Instance.new("Frame")
|
||||
gearContextMenu.Active = true
|
||||
gearContextMenu.Name = "UnequipContextMenu"
|
||||
gearContextMenu.Size = UDim2.new(0,115,0,70)
|
||||
gearContextMenu.Position = UDim2.new(0,-16,0,-16)
|
||||
gearContextMenu.BackgroundTransparency = 1
|
||||
gearContextMenu.Visible = false
|
||||
|
||||
local gearContextMenuButton = Instance.new("TextButton")
|
||||
gearContextMenuButton.Name = "UnequipContextMenuButton"
|
||||
gearContextMenuButton.Text = ""
|
||||
gearContextMenuButton.Style = Enum.ButtonStyle.RobloxButtonDefault
|
||||
gearContextMenuButton.ZIndex = 8
|
||||
gearContextMenuButton.Size = UDim2.new(1, 0, 1, -20)
|
||||
gearContextMenuButton.Visible = true
|
||||
gearContextMenuButton.Parent = gearContextMenu
|
||||
|
||||
local elementHeight = 12
|
||||
|
||||
local contextMenuElements = {}
|
||||
local contextMenuElementsName = {"Remove Hotkey"}
|
||||
|
||||
for i = 1, #contextMenuElementsName do
|
||||
local element = {}
|
||||
element.Type = "Button"
|
||||
element.Text = contextMenuElementsName[i]
|
||||
element.Action = i
|
||||
element.DoIt = UnequipGearMenuClick
|
||||
table.insert(contextMenuElements,element)
|
||||
end
|
||||
|
||||
for i, contextElement in ipairs(contextMenuElements) do
|
||||
local element = contextElement
|
||||
if element.Type == "Button" then
|
||||
local button = Instance.new("TextButton")
|
||||
button.Name = "UnequipContextButton" .. i
|
||||
button.BackgroundColor3 = Color3.new(0,0,0)
|
||||
button.BorderSizePixel = 0
|
||||
button.TextXAlignment = Enum.TextXAlignment.Left
|
||||
button.Text = " " .. contextElement.Text
|
||||
button.Font = Enum.Font.Arial
|
||||
button.FontSize = Enum.FontSize.Size14
|
||||
button.Size = UDim2.new(1, 8, 0, elementHeight)
|
||||
button.Position = UDim2.new(0,0,0,elementHeight * i)
|
||||
button.TextColor3 = Color3.new(1,1,1)
|
||||
button.ZIndex = 9
|
||||
button.Parent = gearContextMenuButton
|
||||
|
||||
if not IsTouchDevice() then
|
||||
|
||||
button.MouseButton1Click:connect(function()
|
||||
if button.Active and not gearContextMenu.Parent.Active then
|
||||
local success, result = pcall(function() element.DoIt(element, gearContextMenu) end)
|
||||
browsingMenu = false
|
||||
gearContextMenu.Visible = false
|
||||
clearHighlight(button)
|
||||
clearPreview()
|
||||
end
|
||||
end)
|
||||
|
||||
button.MouseEnter:connect(function()
|
||||
if button.Active and gearContextMenu.Parent.Active then
|
||||
highlight(button)
|
||||
end
|
||||
end)
|
||||
button.MouseLeave:connect(function()
|
||||
if button.Active and gearContextMenu.Parent.Active then
|
||||
clearHighlight(button)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
contextElement.Button = button
|
||||
contextElement.Element = button
|
||||
elseif element.Type == "Label" then
|
||||
local frame = Instance.new("Frame")
|
||||
frame.Name = "ContextLabel" .. i
|
||||
frame.BackgroundTransparency = 1
|
||||
frame.Size = UDim2.new(1, 8, 0, elementHeight)
|
||||
|
||||
local label = Instance.new("TextLabel")
|
||||
label.Name = "Text1"
|
||||
label.BackgroundTransparency = 1
|
||||
label.BackgroundColor3 = Color3.new(1,1,1)
|
||||
label.BorderSizePixel = 0
|
||||
label.TextXAlignment = Enum.TextXAlignment.Left
|
||||
label.Font = Enum.Font.ArialBold
|
||||
label.FontSize = Enum.FontSize.Size14
|
||||
label.Position = UDim2.new(0.0, 0, 0, 0)
|
||||
label.Size = UDim2.new(0.5, 0, 1, 0)
|
||||
label.TextColor3 = Color3.new(1,1,1)
|
||||
label.ZIndex = 9
|
||||
label.Parent = frame
|
||||
element.Label1 = label
|
||||
|
||||
if element.GetText2 then
|
||||
label = Instance.new("TextLabel")
|
||||
label.Name = "Text2"
|
||||
label.BackgroundTransparency = 1
|
||||
label.BackgroundColor3 = Color3.new(1,1,1)
|
||||
label.BorderSizePixel = 0
|
||||
label.TextXAlignment = Enum.TextXAlignment.Right
|
||||
label.Font = Enum.Font.Arial
|
||||
label.FontSize = Enum.FontSize.Size14
|
||||
label.Position = UDim2.new(0.5, 0, 0, 0)
|
||||
label.Size = UDim2.new(0.5, 0, 1, 0)
|
||||
label.TextColor3 = Color3.new(1,1,1)
|
||||
label.ZIndex = 9
|
||||
label.Parent = frame
|
||||
element.Label2 = label
|
||||
end
|
||||
frame.Parent = gearContextMenuButton
|
||||
element.Label = frame
|
||||
element.Element = frame
|
||||
end
|
||||
end
|
||||
|
||||
gearContextMenu.ZIndex = 4
|
||||
gearContextMenu.MouseLeave:connect(function()
|
||||
browsingMenu = false
|
||||
gearContextMenu.Visible = false
|
||||
clearPreview()
|
||||
end)
|
||||
robloxLock(gearContextMenu)
|
||||
|
||||
return gearContextMenu
|
||||
end
|
||||
|
||||
local backpackChildren = player.Backpack:GetChildren()
|
||||
for i = 1, #backpackChildren do
|
||||
addToGrid(backpackChildren[i])
|
||||
end
|
||||
|
||||
------------------------- Start Lifelong Connections -----------------------
|
||||
|
||||
|
||||
resizeEvent.Event:connect(function(absSize)
|
||||
if debounce then return end
|
||||
|
||||
debounce = true
|
||||
wait()
|
||||
resize()
|
||||
resizeGrid()
|
||||
debounce = false
|
||||
end)
|
||||
|
||||
currentLoadout.ChildAdded:connect(function(child) loadoutCheck(child, false) end)
|
||||
currentLoadout.ChildRemoved:connect(function(child) loadoutCheck(child, true) end)
|
||||
|
||||
currentLoadout.DescendantAdded:connect(function(descendant)
|
||||
if not backpack.Visible and ( descendant:IsA("ImageButton") or descendant:IsA("TextButton") ) then
|
||||
centerGear(currentLoadout:GetChildren())
|
||||
end
|
||||
end)
|
||||
currentLoadout.DescendantRemoving:connect(function(descendant)
|
||||
if not backpack.Visible and ( descendant:IsA("ImageButton") or descendant:IsA("TextButton") ) then
|
||||
wait()
|
||||
centerGear(currentLoadout:GetChildren())
|
||||
end
|
||||
end)
|
||||
|
||||
grid.MouseEnter:connect(function() clearPreview() end)
|
||||
grid.MouseLeave:connect(function() clearPreview() end)
|
||||
|
||||
player.CharacterRemoving:connect(function()
|
||||
removeCharacterConnections()
|
||||
nukeBackpack()
|
||||
end)
|
||||
player.CharacterAdded:connect(function() setupCharacterConnections() end)
|
||||
|
||||
player.ChildAdded:connect(function(child)
|
||||
if child:IsA("Backpack") then
|
||||
playerBackpack = child
|
||||
if backpackAddCon then backpackAddCon:disconnect() end
|
||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) addToGrid(child) end)
|
||||
end
|
||||
end)
|
||||
|
||||
swapSlot.Changed:connect(function()
|
||||
if not swapSlot.Value then
|
||||
updateGridActive()
|
||||
end
|
||||
end)
|
||||
|
||||
local loadoutChildren = currentLoadout:GetChildren()
|
||||
for i = 1, #loadoutChildren do
|
||||
if loadoutChildren[i]:IsA("Frame") and string.find(loadoutChildren[i].Name,"Slot") then
|
||||
loadoutChildren[i].ChildRemoved:connect(function()
|
||||
updateGridActive()
|
||||
end)
|
||||
loadoutChildren[i].ChildAdded:connect(function()
|
||||
updateGridActive()
|
||||
end)
|
||||
end
|
||||
end
|
||||
------------------------- End Lifelong Connections -----------------------
|
||||
|
||||
resize()
|
||||
resizeGrid()
|
||||
|
||||
-- make sure any items in the loadout are accounted for in inventory
|
||||
local loadoutChildren = currentLoadout:GetChildren()
|
||||
for i = 1, #loadoutChildren do
|
||||
loadoutCheck(loadoutChildren[i], false)
|
||||
end
|
||||
if not backpack.Visible then centerGear(currentLoadout:GetChildren()) end
|
||||
|
||||
-- make sure that inventory is listening to gear reparenting
|
||||
if characterChildAddedCon == nil and game.Players.LocalPlayer["Character"] then
|
||||
setupCharacterConnections()
|
||||
end
|
||||
if not backpackAddCon then
|
||||
backpackAddCon = game.Players.LocalPlayer.Backpack.ChildAdded:connect(function(child) addToGrid(child) end)
|
||||
end
|
||||
|
||||
backpackOpenEvent.Event:connect(backpackOpenHandler)
|
||||
backpackCloseEvent.Event:connect(backpackCloseHandler)
|
||||
tabClickedEvent.Event:connect(tabClickHandler)
|
||||
searchRequestedEvent.Event:connect(showSearchGear)
|
||||
|
||||
recalculateScrollLoadout()
|
||||
return t
|
||||
1021
public/asset/15
1021
public/asset/15
File diff suppressed because it is too large
Load Diff
147
public/asset/16
147
public/asset/16
|
|
@ -1,147 +0,0 @@
|
|||
%16%
|
||||
-- Responsible for giving out tools in personal servers
|
||||
|
||||
-- first, lets see if buildTools have already been created
|
||||
-- create the object in lighting (TODO: move to some sort of "container" object when we have one)
|
||||
local toolsArray = game.Lighting:FindFirstChild("BuildToolsModel")
|
||||
local ownerArray = game.Lighting:FindFirstChild("OwnerToolsModel")
|
||||
local hasBuildTools = false
|
||||
|
||||
function getIds(idTable, assetTable)
|
||||
for i = 1, #idTable do
|
||||
local model = game:GetService("InsertService"):LoadAsset(idTable[i])
|
||||
if model then
|
||||
local children = model:GetChildren()
|
||||
for i = 1, #children do
|
||||
if children[i]:IsA("Tool") then
|
||||
table.insert(assetTable,children[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function storeInLighting(modelName, assetTable)
|
||||
local model = Instance.new("Model")
|
||||
model.Archivable = false
|
||||
model.Name = modelName
|
||||
|
||||
for i = 1, #assetTable do
|
||||
assetTable[i].Parent = model
|
||||
end
|
||||
|
||||
if not game.Lighting:FindFirstChild(modelName) then -- no one beat us to it, we get to insert
|
||||
model.Parent = game.Lighting
|
||||
end
|
||||
end
|
||||
|
||||
if not toolsArray then -- no one has made build tools yet, we get to!
|
||||
local buildToolIds = {}
|
||||
local ownerToolIds = {}
|
||||
|
||||
table.insert(buildToolIds,73089166) -- PartSelectionTool
|
||||
table.insert(buildToolIds,73089190) -- DeleteTool
|
||||
table.insert(buildToolIds,73089204) -- CloneTool
|
||||
table.insert(buildToolIds,73089214) -- RotateTool
|
||||
table.insert(buildToolIds,73089239) -- ConfigTool
|
||||
table.insert(buildToolIds,73089259) -- WiringTool
|
||||
table.insert(buildToolIds,58921588) -- ClassicTool
|
||||
|
||||
table.insert(ownerToolIds, 65347268)
|
||||
|
||||
-- next, create array of our tools
|
||||
local buildTools = {}
|
||||
local ownerTools = {}
|
||||
|
||||
getIds(buildToolIds, buildTools)
|
||||
getIds(ownerToolIds, ownerTools)
|
||||
|
||||
storeInLighting("BuildToolsModel",buildTools)
|
||||
storeInLighting("OwnerToolsModel",ownerTools)
|
||||
|
||||
toolsArray = game.Lighting:FindFirstChild("BuildToolsModel")
|
||||
ownerArray = game.Lighting:FindFirstChild("OwnerToolsModel")
|
||||
end
|
||||
|
||||
local localBuildTools = {}
|
||||
|
||||
function giveBuildTools()
|
||||
if not hasBuildTools then
|
||||
hasBuildTools = true
|
||||
local theTools = toolsArray:GetChildren()
|
||||
for i = 1, #theTools do
|
||||
local toolClone = theTools[i]:clone()
|
||||
if toolClone then
|
||||
toolClone.Parent = game.Players.LocalPlayer.Backpack
|
||||
table.insert(localBuildTools,toolClone)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function giveOwnerTools()
|
||||
local theOwnerTools = ownerArray:GetChildren()
|
||||
for i = 1, #theOwnerTools do
|
||||
local ownerToolClone = theOwnerTools[i]:clone()
|
||||
if ownerToolClone then
|
||||
ownerToolClone.Parent = game.Players.LocalPlayer.Backpack
|
||||
table.insert(localBuildTools,ownerToolClone)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function removeBuildTools()
|
||||
if hasBuildTools then
|
||||
hasBuildTools = false
|
||||
for i = 1, #localBuildTools do
|
||||
localBuildTools[i].Parent = nil
|
||||
end
|
||||
localBuildTools = {}
|
||||
end
|
||||
end
|
||||
|
||||
if game.Players.LocalPlayer.HasBuildTools then
|
||||
giveBuildTools()
|
||||
end
|
||||
if game.Players.LocalPlayer.PersonalServerRank >= 255 then
|
||||
giveOwnerTools()
|
||||
end
|
||||
|
||||
local debounce = false
|
||||
game.Players.LocalPlayer.Changed:connect(function(prop)
|
||||
if prop == "HasBuildTools" then
|
||||
while debounce do
|
||||
wait(0.5)
|
||||
end
|
||||
|
||||
debounce = true
|
||||
|
||||
if game.Players.LocalPlayer.HasBuildTools then
|
||||
giveBuildTools()
|
||||
else
|
||||
removeBuildTools()
|
||||
end
|
||||
|
||||
if game.Players.LocalPlayer.PersonalServerRank >= 255 then
|
||||
giveOwnerTools()
|
||||
end
|
||||
|
||||
debounce = false
|
||||
elseif prop == "PersonalServerRank" then
|
||||
if game.Players.LocalPlayer.PersonalServerRank >= 255 then
|
||||
giveOwnerTools()
|
||||
elseif game.Players.LocalPlayer.PersonalServerRank <= 0 then
|
||||
game.Players.LocalPlayer:Remove() -- you're banned, goodbye!
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
game.Players.LocalPlayer.CharacterAdded:connect(function()
|
||||
hasBuildTools = false
|
||||
if game.Players.LocalPlayer.HasBuildTools then
|
||||
giveBuildTools()
|
||||
end
|
||||
if game.Players.LocalPlayer.PersonalServerRank >= 255 then
|
||||
giveOwnerTools()
|
||||
end
|
||||
end)
|
||||
3845
public/asset/17
3845
public/asset/17
File diff suppressed because it is too large
Load Diff
|
|
@ -1,24 +0,0 @@
|
|||
%18%
|
||||
local t = {}
|
||||
|
||||
t.Foo =
|
||||
function()
|
||||
print("foo")
|
||||
end
|
||||
|
||||
t.Bar =
|
||||
function()
|
||||
print("bar")
|
||||
end
|
||||
|
||||
t.Help =
|
||||
function(funcNameOrFunc)
|
||||
--input argument can be a string or a function. Should return a description (of arguments and expected side effects)
|
||||
if funcNameOrFunc == "Foo" or funcNameOrFunc == t.Foo then
|
||||
return "Function Foo. Arguments: None. Side effect: prints foo"
|
||||
elseif funcNameOrFunc == "Bar" or funcNameOrFunc == t.Bar then
|
||||
return "Function Bar. Arguments: None. Side effect: prints bar"
|
||||
end
|
||||
end
|
||||
|
||||
return t
|
||||
1116
public/asset/19
1116
public/asset/19
File diff suppressed because it is too large
Load Diff
|
|
@ -1,23 +1,71 @@
|
|||
%2%
|
||||
-- Library Registration Script
|
||||
-- This script is used to register RbxLua libraries on game servers, so game scripts have
|
||||
-- access to all of the libraries (otherwise only local scripts do)
|
||||
-- this script is responsible for keeping the gui proportions under control
|
||||
|
||||
local sc = game:GetService("ScriptContext")
|
||||
local tries = 0
|
||||
|
||||
while not sc and tries < 3 do
|
||||
tries = tries + 1
|
||||
sc = game:GetService("ScriptContext")
|
||||
wait(0.2)
|
||||
local screen = script.Parent
|
||||
|
||||
local BottomLeftControl
|
||||
local BottomRightControl
|
||||
local TopLeftControl
|
||||
local BuildTools
|
||||
|
||||
local controlFrame = script.Parent:FindFirstChild("ControlFrame")
|
||||
local loadoutPadding = 43
|
||||
local currentLoadout
|
||||
|
||||
BottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl")
|
||||
BottomRightControl = controlFrame:FindFirstChild("BottomRightControl")
|
||||
TopLeftControl = controlFrame:FindFirstChild("TopLeftControl")
|
||||
currentLoadout = script.Parent:FindFirstChild("CurrentLoadout")
|
||||
BuildTools = controlFrame:FindFirstChild("BuildTools")
|
||||
|
||||
function makeYRelative()
|
||||
|
||||
BottomLeftControl.SizeConstraint = 2
|
||||
BottomRightControl.SizeConstraint = 2
|
||||
if TopLeftControl then TopLeftControl.SizeConstraint = 2 end
|
||||
if currentLoadout then currentLoadout.SizeConstraint = 2 end
|
||||
if BuildTools then BuildTools.Frame.SizeConstraint = 2 end
|
||||
|
||||
BottomLeftControl.Position = UDim2.new(0,0,1,-BottomLeftControl.AbsoluteSize.Y)
|
||||
BottomRightControl.Position = UDim2.new(1,-BottomRightControl.AbsoluteSize.X,1,-BottomRightControl.AbsoluteSize.Y)
|
||||
|
||||
end
|
||||
|
||||
if sc then
|
||||
sc:RegisterLibrary("Libraries/RbxGui", "17")
|
||||
sc:RegisterLibrary("Libraries/RbxGear", "18")
|
||||
sc:RegisterLibrary("Libraries/RbxUtility", "19")
|
||||
sc:RegisterLibrary("Libraries/RbxStamper", "20")
|
||||
sc:LibraryRegistrationComplete()
|
||||
else
|
||||
print("failed to find script context, libraries did not load")
|
||||
|
||||
|
||||
|
||||
function makeXRelative()
|
||||
|
||||
BottomLeftControl.SizeConstraint = 1
|
||||
BottomRightControl.SizeConstraint = 1
|
||||
if TopLeftControl then TopLeftControl.SizeConstraint = 1 end
|
||||
if currentLoadout then currentLoadout.SizeConstraint = 1 end
|
||||
if BuildTools then BuildTools.Frame.SizeConstraint = 1 end
|
||||
|
||||
BottomLeftControl.Position = UDim2.new(0,0,1,-BottomLeftControl.AbsoluteSize.Y)
|
||||
BottomRightControl.Position = UDim2.new(1,-BottomRightControl.AbsoluteSize.X,1,-BottomRightControl.AbsoluteSize.Y)
|
||||
|
||||
end
|
||||
|
||||
local function resize()
|
||||
if screen.AbsoluteSize.x > screen.AbsoluteSize.y then
|
||||
makeYRelative()
|
||||
else
|
||||
makeXRelative()
|
||||
end
|
||||
if currentLoadout then
|
||||
currentLoadout.Position =
|
||||
UDim2.new(0,screen.AbsoluteSize.X/2 -currentLoadout.AbsoluteSize.X/2,currentLoadout.Position.Y.Scale,-currentLoadout.AbsoluteSize.Y - loadoutPadding)
|
||||
end
|
||||
end
|
||||
screen.Changed:connect(function(property)
|
||||
|
||||
if property == "AbsoluteSize" then
|
||||
wait()
|
||||
resize()
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
wait()
|
||||
resize()
|
||||
|
||||
|
|
|
|||
2208
public/asset/20
2208
public/asset/20
File diff suppressed because it is too large
Load Diff
290
public/asset/3
290
public/asset/3
|
|
@ -1 +1,291 @@
|
|||
%3%
|
||||
-- creates the in-game gui sub menus for property tools
|
||||
-- written 9/27/2010 by Ben (jeditkacheff)
|
||||
|
||||
local gui = script.Parent
|
||||
if gui:FindFirstChild("ControlFrame") then
|
||||
gui = gui:FindFirstChild("ControlFrame")
|
||||
end
|
||||
|
||||
local currentlySelectedButton = nil
|
||||
|
||||
local localAssetBase = "rbxasset://textures/ui/"
|
||||
|
||||
local selectedButton = Instance.new("ObjectValue")
|
||||
selectedButton.RobloxLocked = true
|
||||
selectedButton.Name = "SelectedButton"
|
||||
selectedButton.Parent = gui.BuildTools
|
||||
|
||||
local closeButton = Instance.new("ImageButton")
|
||||
closeButton.Name = "CloseButton"
|
||||
closeButton.RobloxLocked = true
|
||||
closeButton.BackgroundTransparency = 1
|
||||
closeButton.Image = localAssetBase .. "CloseButton.png"
|
||||
closeButton.ZIndex = 2
|
||||
closeButton.Size = UDim2.new(0.2,0,0.05,0)
|
||||
closeButton.AutoButtonColor = false
|
||||
closeButton.Position = UDim2.new(0.75,0,0.01,0)
|
||||
|
||||
|
||||
|
||||
function setUpCloseButtonState(button)
|
||||
|
||||
button.MouseEnter:connect(function()
|
||||
button.Image = localAssetBase .. "CloseButton_dn.png"
|
||||
end)
|
||||
button.MouseLeave:connect(function()
|
||||
button.Image = localAssetBase .. "CloseButton.png"
|
||||
end)
|
||||
button.MouseButton1Click:connect(function()
|
||||
button.ClosedState.Value = true
|
||||
button.Image = localAssetBase .. "CloseButton.png"
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
-- nice selection animation
|
||||
function fadeInButton(button)
|
||||
|
||||
if currentlySelectedButton ~= nil then
|
||||
currentlySelectedButton.Selected = false
|
||||
currentlySelectedButton.ZIndex = 2
|
||||
currentlySelectedButton.Frame.BackgroundTransparency = 1
|
||||
end
|
||||
|
||||
local speed = 0.1
|
||||
button.ZIndex = 3
|
||||
while button.Frame.BackgroundTransparency > 0 do
|
||||
button.Frame.BackgroundTransparency = button.Frame.BackgroundTransparency - speed
|
||||
wait()
|
||||
end
|
||||
button.Selected = true
|
||||
|
||||
currentlySelectedButton = button
|
||||
selectedButton.Value = currentlySelectedButton
|
||||
end
|
||||
|
||||
------------------------------- create the color selection sub menu -----------------------------------
|
||||
|
||||
local paintMenu = Instance.new("ImageLabel")
|
||||
local paintTool = gui.BuildTools.Frame.PropertyTools.PaintTool
|
||||
paintMenu.Name = "PaintMenu"
|
||||
paintMenu.RobloxLocked = true
|
||||
paintMenu.Parent = paintTool
|
||||
paintMenu.Position = UDim2.new(-2.7,0,-3,0)
|
||||
paintMenu.Size = UDim2.new(2.5,0,10,0)
|
||||
paintMenu.BackgroundTransparency = 1
|
||||
paintMenu.ZIndex = 2
|
||||
paintMenu.Image = localAssetBase .. "PaintMenu.png"
|
||||
|
||||
local paintColorButton = Instance.new("ImageButton")
|
||||
paintColorButton.RobloxLocked = true
|
||||
paintColorButton.BorderSizePixel = 0
|
||||
paintColorButton.ZIndex = 2
|
||||
paintColorButton.Size = UDim2.new(0.200000003, 0,0.0500000007, 0)
|
||||
|
||||
local selection = Instance.new("Frame")
|
||||
selection.RobloxLocked = true
|
||||
selection.BorderSizePixel = 0
|
||||
selection.BackgroundColor3 = Color3.new(1,1,1)
|
||||
selection.BackgroundTransparency = 1
|
||||
selection.ZIndex = 2
|
||||
selection.Size = UDim2.new(1.1,0,1.1,0)
|
||||
selection.Position = UDim2.new(-0.05,0,-0.05,0)
|
||||
selection.Parent = paintColorButton
|
||||
|
||||
local header = 0.08
|
||||
local spacing = 18
|
||||
|
||||
local count = 1
|
||||
|
||||
function findNextColor()
|
||||
colorName = tostring(BrickColor.new(count))
|
||||
while colorName == "Medium stone grey" do
|
||||
count = count + 1
|
||||
colorName = tostring(BrickColor.new(count))
|
||||
end
|
||||
return count
|
||||
end
|
||||
|
||||
for i = 0,15 do
|
||||
for j = 1, 4 do
|
||||
newButton = paintColorButton:clone()
|
||||
newButton.RobloxLocked = true
|
||||
newButton.BackgroundColor3 = BrickColor.new(findNextColor()).Color
|
||||
newButton.Name = tostring(BrickColor.new(count))
|
||||
count = count + 1
|
||||
if j == 1 then newButton.Position = UDim2.new(0.08,0,i/spacing + header,0)
|
||||
elseif j == 2 then newButton.Position = UDim2.new(0.29,0,i/spacing + header,0)
|
||||
elseif j == 3 then newButton.Position = UDim2.new(0.5,0,i/spacing + header,0)
|
||||
elseif j == 4 then newButton.Position = UDim2.new(0.71,0,i/spacing + header,0) end
|
||||
newButton.Parent = paintMenu
|
||||
end
|
||||
end
|
||||
|
||||
local paintButtons = paintMenu:GetChildren()
|
||||
for i = 1, #paintButtons do
|
||||
paintButtons[i].MouseButton1Click:connect(function()
|
||||
fadeInButton(paintButtons[i])
|
||||
end)
|
||||
end
|
||||
|
||||
local paintCloseButton = closeButton:clone()
|
||||
paintCloseButton.RobloxLocked = true
|
||||
paintCloseButton.Parent = paintMenu
|
||||
|
||||
local closedState = Instance.new("BoolValue")
|
||||
closedState.RobloxLocked = true
|
||||
closedState.Name = "ClosedState"
|
||||
closedState.Parent = paintCloseButton
|
||||
|
||||
setUpCloseButtonState(paintCloseButton)
|
||||
|
||||
------------------------------- create the material selection sub menu -----------------------------------
|
||||
|
||||
local materialMenu = Instance.new("ImageLabel")
|
||||
local materialTool = gui.BuildTools.Frame.PropertyTools.MaterialSelector
|
||||
materialMenu.RobloxLocked = true
|
||||
materialMenu.Name = "MaterialMenu"
|
||||
materialMenu.Position = UDim2.new(-4,0,-3,0)
|
||||
materialMenu.Size = UDim2.new(2.5,0,6.5,0)
|
||||
materialMenu.BackgroundTransparency = 1
|
||||
materialMenu.ZIndex = 2
|
||||
materialMenu.Image = localAssetBase .. "MaterialMenu.png"
|
||||
materialMenu.Parent = materialTool
|
||||
|
||||
local textures = {"Plastic","Wood","Slate","CorrodedMetal","Ice","Grass","Foil","DiamondPlate","Concrete"}
|
||||
|
||||
local materialButtons = {}
|
||||
|
||||
local materialButton = Instance.new("ImageButton")
|
||||
materialButton.RobloxLocked = true
|
||||
materialButton.BackgroundTransparency = 1
|
||||
materialButton.Size = UDim2.new(0.400000003, 0,0.16, 0)
|
||||
materialButton.ZIndex = 2
|
||||
|
||||
selection.Parent = materialButton
|
||||
|
||||
local current = 1
|
||||
function getTextureAndName(button)
|
||||
|
||||
if current > #textures then
|
||||
button:remove()
|
||||
return false
|
||||
end
|
||||
button.Image = localAssetBase .. textures[current] .. ".png"
|
||||
button.Name = textures[current]
|
||||
current = current + 1
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
local ySpacing = 0.10
|
||||
local xSpacing = 0.07
|
||||
for i = 1,5 do
|
||||
for j = 1,2 do
|
||||
local button = materialButton:clone()
|
||||
button.RobloxLocked = true
|
||||
button.Position = UDim2.new((j -1)/2.2 + xSpacing,0,ySpacing + (i - 1)/5.5,0)
|
||||
if getTextureAndName(button) then button.Parent = materialMenu else button:remove() end
|
||||
table.insert(materialButtons,button)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for i = 1, #materialButtons do
|
||||
materialButtons[i].MouseButton1Click:connect(function()
|
||||
fadeInButton(materialButtons[i])
|
||||
end)
|
||||
end
|
||||
|
||||
local materialCloseButton = closeButton:clone()
|
||||
materialCloseButton.RobloxLocked = true
|
||||
materialCloseButton.Size = UDim2.new(0.2,0,0.08,0)
|
||||
materialCloseButton.Parent = materialMenu
|
||||
|
||||
local closedState = Instance.new("BoolValue")
|
||||
closedState.RobloxLocked = true
|
||||
closedState.Name = "ClosedState"
|
||||
closedState.Parent = materialCloseButton
|
||||
|
||||
setUpCloseButtonState(materialCloseButton)
|
||||
|
||||
|
||||
------------------------------- create the surface selection sub menu -----------------------------------
|
||||
|
||||
local surfaceMenu = Instance.new("ImageLabel")
|
||||
local surfaceTool = gui.BuildTools.Frame.PropertyTools.InputSelector
|
||||
surfaceMenu.RobloxLocked = true
|
||||
surfaceMenu.Name = "SurfaceMenu"
|
||||
surfaceMenu.Position = UDim2.new(-2.6,0,-4,0)
|
||||
surfaceMenu.Size = UDim2.new(2.5,0,5.5,0)
|
||||
surfaceMenu.BackgroundTransparency = 1
|
||||
surfaceMenu.ZIndex = 2
|
||||
surfaceMenu.Image = localAssetBase .. "SurfaceMenu.png"
|
||||
surfaceMenu.Parent = surfaceTool
|
||||
|
||||
textures = {"Smooth", "Studs", "Inlets", "Universal", "Glue", "Weld", "Hinge", "Motor"}
|
||||
current = 1
|
||||
|
||||
local surfaceButtons = {}
|
||||
|
||||
local surfaceButton = Instance.new("ImageButton")
|
||||
surfaceButton.RobloxLocked = true
|
||||
surfaceButton.BackgroundTransparency = 1
|
||||
surfaceButton.Size = UDim2.new(0.400000003, 0,0.19, 0)
|
||||
surfaceButton.ZIndex = 2
|
||||
|
||||
selection.Parent = surfaceButton
|
||||
|
||||
local ySpacing = 0.14
|
||||
local xSpacing = 0.07
|
||||
for i = 1,4 do
|
||||
for j = 1,2 do
|
||||
local button = surfaceButton:clone()
|
||||
button.RobloxLocked = true
|
||||
button.Position = UDim2.new((j -1)/2.2 + xSpacing,0,ySpacing + (i - 1)/4.6,0)
|
||||
getTextureAndName(button)
|
||||
button.Parent = surfaceMenu
|
||||
table.insert(surfaceButtons,button)
|
||||
end
|
||||
end
|
||||
|
||||
for i = 1, #surfaceButtons do
|
||||
surfaceButtons[i].MouseButton1Click:connect(function()
|
||||
fadeInButton(surfaceButtons[i])
|
||||
end)
|
||||
end
|
||||
|
||||
local surfaceMenuCloseButton = closeButton:clone()
|
||||
surfaceMenuCloseButton.RobloxLocked = true
|
||||
surfaceMenuCloseButton.Size = UDim2.new(0.2,0,0.09,0)
|
||||
surfaceMenuCloseButton.Parent = surfaceMenu
|
||||
|
||||
local closedState = Instance.new("BoolValue")
|
||||
closedState.RobloxLocked = true
|
||||
closedState.Name = "ClosedState"
|
||||
closedState.Parent = surfaceMenuCloseButton
|
||||
|
||||
setUpCloseButtonState(surfaceMenuCloseButton)
|
||||
|
||||
if game.CoreGui.Version >= 2 then
|
||||
local function setupTweenTransition(button, menu, outXScale, inXScale)
|
||||
button.Changed:connect(
|
||||
function(property)
|
||||
if property ~= "Selected" then
|
||||
return
|
||||
end
|
||||
if button.Selected then
|
||||
menu:TweenPosition(UDim2.new(inXScale, menu.Position.X.Offset, menu.Position.Y.Scale, menu.Position.Y.Offset),
|
||||
Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 1, true)
|
||||
else
|
||||
menu:TweenPosition(UDim2.new(outXScale, menu.Position.X.Offset, menu.Position.Y.Scale, menu.Position.Y.Offset),
|
||||
Enum.EasingDirection.In, Enum.EasingStyle.Quart, 0.5, true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
setupTweenTransition(paintTool, paintMenu, -2.7, 2.6)
|
||||
setupTweenTransition(surfaceTool, surfaceMenu, -2.6, 2.6)
|
||||
setupTweenTransition(materialTool, materialMenu, -4, 1.4)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,393 @@
|
|||
%38037265%
|
||||
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.morblox.us/roblox.xsd" version="4">
|
||||
<External>null</External>
|
||||
<External>nil</External>
|
||||
<Item class="Script" referent="RBX0">
|
||||
<Properties>
|
||||
<bool name="Disabled">false</bool>
|
||||
<Content name="LinkedSource"><null></null></Content>
|
||||
<string name="Name">Health</string>
|
||||
<ProtectedString name="Source">function waitForChild(parent, childName)
|
||||
local child = parent:findFirstChild(childName)
|
||||
if child then return child end
|
||||
while true do
|
||||
child = parent.ChildAdded:wait()
|
||||
if child.Name==childName then return child end
|
||||
end
|
||||
end
|
||||
|
||||
-- declarations
|
||||
local Figure = script.Parent
|
||||
local Head = waitForChild(Figure, "Head")
|
||||
local Humanoid = waitForChild(Figure, "Humanoid")
|
||||
local regening = false
|
||||
|
||||
-- regeneration
|
||||
function regenHealth()
|
||||
if regening then return end
|
||||
regening = true
|
||||
while Humanoid.Health < Humanoid.MaxHealth do
|
||||
local s = wait(1)
|
||||
local health = Humanoid.Health
|
||||
if health > 0 and health < Humanoid.MaxHealth then
|
||||
local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
|
||||
health = health + newHealthDelta
|
||||
Humanoid.Health = math.min(health,Humanoid.MaxHealth)
|
||||
end
|
||||
end
|
||||
if Humanoid.Health > Humanoid.MaxHealth then
|
||||
Humanoid.Health = Humanoid.MaxHealth
|
||||
end
|
||||
regening = false
|
||||
end
|
||||
|
||||
Humanoid.HealthChanged:connect(regenHealth)
|
||||
</ProtectedString>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
</Item>
|
||||
<Item class="Script" referent="RBX1">
|
||||
<Properties>
|
||||
<bool name="Disabled">false</bool>
|
||||
<Content name="LinkedSource"><null></null></Content>
|
||||
<string name="Name">HealthScript v3.1</string>
|
||||
<ProtectedString name="Source">local HealthGUI_prototype = script:FindFirstChild("HealthGUI")
|
||||
local lastHealth = 100
|
||||
local lastHealth2 = 100
|
||||
local maxWidth = 0.96
|
||||
|
||||
local humanoid = script.Parent.Humanoid
|
||||
|
||||
if (humanoid == nil) then
|
||||
print("ERROR: no humanoid found in 'HealthScript v3.1'")
|
||||
end
|
||||
|
||||
|
||||
function CreateGUI()
|
||||
local p = game.Players:GetPlayerFromCharacter(humanoid.Parent)
|
||||
HealthGUI_prototype.Parent = p.PlayerGui
|
||||
end
|
||||
|
||||
function UpdateGUI(health)
|
||||
tray = HealthGUI_prototype.tray
|
||||
local width = (health / humanoid.MaxHealth) * maxWidth
|
||||
local height = 0.83
|
||||
local lastX = tray.bar.Position.X.Scale
|
||||
local x = 0.019 + (maxWidth - width)
|
||||
local y = 0.1
|
||||
|
||||
tray.bar.Position = UDim2.new(x,0,y, 0)
|
||||
tray.bar.Size = UDim2.new(width, 0, height, 0)
|
||||
-- If more than 1/4 health, bar = green. Else, bar = red.
|
||||
if( (health / humanoid.MaxHealth) > 0.25 ) then
|
||||
tray.barRed.Size = UDim2.new(0, 0, 0, 0)
|
||||
else
|
||||
tray.barRed.Position = tray.bar.Position
|
||||
tray.barRed.Size = tray.bar.Size
|
||||
tray.bar.Size = UDim2.new(0, 0, 0, 0)
|
||||
end
|
||||
|
||||
if ( (lastHealth - health) > (humanoid.MaxHealth / 10) ) then
|
||||
lastHealth = health
|
||||
|
||||
if humanoid.Health ~= humanoid.MaxHealth then
|
||||
delay(0,function()
|
||||
AnimateHurtOverlay()
|
||||
end)
|
||||
delay(0,function()
|
||||
AnimateBars(x, y, lastX, height)
|
||||
end)
|
||||
end
|
||||
else
|
||||
lastHealth = health
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function HealthChanged(health)
|
||||
UpdateGUI(health)
|
||||
if ( (lastHealth2 - health) > (humanoid.MaxHealth / 10) ) then
|
||||
lastHealth2 = health
|
||||
else
|
||||
lastHealth2 = health
|
||||
end
|
||||
end
|
||||
|
||||
function AnimateBars(x, y, lastX, height)
|
||||
tray = HealthGUI_prototype.tray
|
||||
local width = math.abs(x - lastX)
|
||||
if( x > lastX ) then
|
||||
x = lastX
|
||||
end
|
||||
tray.bar2.Position = UDim2.new(x,0, y, 0)
|
||||
tray.bar2.Size = UDim2.new(width, 0, height, 0)
|
||||
tray.bar2.BackgroundTransparency = 0
|
||||
local GBchannels = 1
|
||||
local j = 0.2
|
||||
|
||||
local i_total = 30
|
||||
for i=1,i_total do
|
||||
-- Increment Values
|
||||
if (GBchannels < 0.2) then
|
||||
j = -j
|
||||
end
|
||||
GBchannels = GBchannels + j
|
||||
if (i > (i_total - 10)) then
|
||||
tray.bar2.BackgroundTransparency = tray.bar2.BackgroundTransparency + 0.1
|
||||
end
|
||||
tray.bar2.BackgroundColor3 = Color3.new(1, GBchannels, GBchannels)
|
||||
|
||||
wait(0.02)
|
||||
end
|
||||
end
|
||||
|
||||
function AnimateHurtOverlay()
|
||||
-- Start:
|
||||
-- overlay.Position = UDim2.new(0, 0, 0, -22)
|
||||
-- overlay.Size = UDim2.new(1, 0, 1.15, 30)
|
||||
|
||||
-- Finish:
|
||||
-- overlay.Position = UDim2.new(-2, 0, -2, -22)
|
||||
-- overlay.Size = UDim2.new(4.5, 0, 4.65, 30)
|
||||
|
||||
overlay = HealthGUI_prototype.hurtOverlay
|
||||
overlay.Position = UDim2.new(-2, 0, -2, -22)
|
||||
overlay.Size = UDim2.new(4.5, 0, 4.65, 30)
|
||||
-- Animate In, fast
|
||||
local i_total = 2
|
||||
local wiggle_total = 0
|
||||
local wiggle_i = 0.02
|
||||
for i=1,i_total do
|
||||
overlay.Position = UDim2.new( (-2 + (2 * (i/i_total)) + wiggle_total/2), 0, (-2 + (2 * (i/i_total)) + wiggle_total/2), -22 )
|
||||
overlay.Size = UDim2.new( (4.5 - (3.5 * (i/i_total)) + wiggle_total), 0, (4.65 - (3.5 * (i/i_total)) + wiggle_total), 30 )
|
||||
wait(0.01)
|
||||
end
|
||||
|
||||
i_total = 30
|
||||
|
||||
wait(0.03)
|
||||
|
||||
-- Animate Out, slow
|
||||
for i=1,i_total do
|
||||
if( math.abs(wiggle_total) > (wiggle_i * 3) ) then
|
||||
wiggle_i = -wiggle_i
|
||||
end
|
||||
wiggle_total = wiggle_total + wiggle_i
|
||||
overlay.Position = UDim2.new( (0 - (2 * (i/i_total)) + wiggle_total/2), 0, (0 - (2 * (i/i_total)) + wiggle_total/2), -22 )
|
||||
overlay.Size = UDim2.new( (1 + (3.5 * (i/i_total)) + wiggle_total), 0, (1.15 + (3.5 * (i/i_total)) + wiggle_total), 30 )
|
||||
wait(0.01)
|
||||
end
|
||||
|
||||
-- Hide after we're done
|
||||
overlay.Position = UDim2.new(10, 0, 0, 0)
|
||||
end
|
||||
|
||||
CreateGUI()
|
||||
humanoid.HealthChanged:connect(HealthChanged)
|
||||
humanoid.Died:connect(function() HealthChanged(0) end)</ProtectedString>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
<Item class="GuiMain" referent="RBX2">
|
||||
<Properties>
|
||||
<string name="Name">HealthGUI</string>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
<Item class="ImageLabel" referent="RBX3">
|
||||
<Properties>
|
||||
<bool name="Active">false</bool>
|
||||
<Color3 name="BackgroundColor3">4290164919</Color3>
|
||||
<float name="BackgroundTransparency">1</float>
|
||||
<Color3 name="BorderColor3">4279970357</Color3>
|
||||
<int name="BorderSizePixel">1</int>
|
||||
<bool name="Draggable">false</bool>
|
||||
<Content name="Image"><url>https://morblox.us/asset/?id=34854607</url></Content>
|
||||
<string name="Name">hurtOverlay</string>
|
||||
<UDim2 name="Position">
|
||||
<XS>2</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0</YS>
|
||||
<YO>-22</YO>
|
||||
</UDim2>
|
||||
<UDim2 name="Size">
|
||||
<XS>1</XS>
|
||||
<XO>0</XO>
|
||||
<YS>1.1500001</YS>
|
||||
<YO>30</YO>
|
||||
</UDim2>
|
||||
<token name="SizeConstraint">0</token>
|
||||
<bool name="Visible">true</bool>
|
||||
<int name="ZIndex">1</int>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
</Item>
|
||||
<Item class="Frame" referent="RBX4">
|
||||
<Properties>
|
||||
<bool name="Active">false</bool>
|
||||
<Color3 name="BackgroundColor3">4285215356</Color3>
|
||||
<float name="BackgroundTransparency">1</float>
|
||||
<Color3 name="BorderColor3">4279970357</Color3>
|
||||
<int name="BorderSizePixel">1</int>
|
||||
<bool name="Draggable">false</bool>
|
||||
<string name="Name">tray</string>
|
||||
<UDim2 name="Position">
|
||||
<XS>0.5</XS>
|
||||
<XO>-44</XO>
|
||||
<YS>1</YS>
|
||||
<YO>-26</YO>
|
||||
</UDim2>
|
||||
<UDim2 name="Size">
|
||||
<XS>0</XS>
|
||||
<XO>170</XO>
|
||||
<YS>0</YS>
|
||||
<YO>18</YO>
|
||||
</UDim2>
|
||||
<token name="SizeConstraint">2</token>
|
||||
<token name="Style">0</token>
|
||||
<bool name="Visible">true</bool>
|
||||
<int name="ZIndex">1</int>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
<Item class="ImageLabel" referent="RBX5">
|
||||
<Properties>
|
||||
<bool name="Active">false</bool>
|
||||
<Color3 name="BackgroundColor3">4294967295</Color3>
|
||||
<float name="BackgroundTransparency">1</float>
|
||||
<Color3 name="BorderColor3">4279970357</Color3>
|
||||
<int name="BorderSizePixel">1</int>
|
||||
<bool name="Draggable">false</bool>
|
||||
<Content name="Image"><url>https://morblox.us/asset/?id=35238000</url></Content>
|
||||
<string name="Name">bkg</string>
|
||||
<UDim2 name="Position">
|
||||
<XS>0</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<UDim2 name="Size">
|
||||
<XS>1</XS>
|
||||
<XO>0</XO>
|
||||
<YS>1</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<token name="SizeConstraint">0</token>
|
||||
<bool name="Visible">true</bool>
|
||||
<int name="ZIndex">1</int>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
</Item>
|
||||
<Item class="ImageLabel" referent="RBX6">
|
||||
<Properties>
|
||||
<bool name="Active">false</bool>
|
||||
<Color3 name="BackgroundColor3">4294967295</Color3>
|
||||
<float name="BackgroundTransparency">1</float>
|
||||
<Color3 name="BorderColor3">4279970357</Color3>
|
||||
<int name="BorderSizePixel">1</int>
|
||||
<bool name="Draggable">false</bool>
|
||||
<Content name="Image"><url>https://morblox.us/asset/?id=35238036</url></Content>
|
||||
<string name="Name">barRed</string>
|
||||
<UDim2 name="Position">
|
||||
<XS>0.0189999994</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0.100000001</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<UDim2 name="Size">
|
||||
<XS>0</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<token name="SizeConstraint">0</token>
|
||||
<bool name="Visible">true</bool>
|
||||
<int name="ZIndex">1</int>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
</Item>
|
||||
<Item class="Frame" referent="RBX7">
|
||||
<Properties>
|
||||
<bool name="Active">false</bool>
|
||||
<Color3 name="BackgroundColor3">4294967295</Color3>
|
||||
<float name="BackgroundTransparency">1.00000012</float>
|
||||
<Color3 name="BorderColor3">4279970357</Color3>
|
||||
<int name="BorderSizePixel">0</int>
|
||||
<bool name="Draggable">false</bool>
|
||||
<string name="Name">bar2</string>
|
||||
<UDim2 name="Position">
|
||||
<XS>0.0189999994</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0.100000001</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<UDim2 name="Size">
|
||||
<XS>0.192000002</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0.829999983</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<token name="SizeConstraint">0</token>
|
||||
<token name="Style">0</token>
|
||||
<bool name="Visible">true</bool>
|
||||
<int name="ZIndex">1</int>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
</Item>
|
||||
<Item class="ImageLabel" referent="RBX8">
|
||||
<Properties>
|
||||
<bool name="Active">false</bool>
|
||||
<Color3 name="BackgroundColor3">4294967295</Color3>
|
||||
<float name="BackgroundTransparency">1</float>
|
||||
<Color3 name="BorderColor3">4279970357</Color3>
|
||||
<int name="BorderSizePixel">1</int>
|
||||
<bool name="Draggable">false</bool>
|
||||
<Content name="Image"><url>https://morblox.us/asset/?id=35238053</url></Content>
|
||||
<string name="Name">bar</string>
|
||||
<UDim2 name="Position">
|
||||
<XS>0.0189999994</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0.100000001</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<UDim2 name="Size">
|
||||
<XS>0.959999979</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0.829999983</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<token name="SizeConstraint">0</token>
|
||||
<bool name="Visible">true</bool>
|
||||
<int name="ZIndex">1</int>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
</Item>
|
||||
<Item class="ImageLabel" referent="RBX9">
|
||||
<Properties>
|
||||
<bool name="Active">false</bool>
|
||||
<Color3 name="BackgroundColor3">4294967295</Color3>
|
||||
<float name="BackgroundTransparency">1</float>
|
||||
<Color3 name="BorderColor3">4279970357</Color3>
|
||||
<int name="BorderSizePixel">0</int>
|
||||
<bool name="Draggable">false</bool>
|
||||
<Content name="Image"><url>https://morblox.us/asset/?id=34816363</url></Content>
|
||||
<string name="Name">label</string>
|
||||
<UDim2 name="Position">
|
||||
<XS>0.680000007</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0.300000012</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<UDim2 name="Size">
|
||||
<XS>0.25</XS>
|
||||
<XO>0</XO>
|
||||
<YS>0.349999994</YS>
|
||||
<YO>0</YO>
|
||||
</UDim2>
|
||||
<token name="SizeConstraint">0</token>
|
||||
<bool name="Visible">true</bool>
|
||||
<int name="ZIndex">1</int>
|
||||
<bool name="archivable">true</bool>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
190
public/asset/4
190
public/asset/4
|
|
@ -1,91 +1,122 @@
|
|||
%4%
|
||||
-- Creates the tool tips for the new gui!
|
||||
|
||||
local controlFrame = script.Parent:FindFirstChild("ControlFrame")
|
||||
|
||||
if not controlFrame then return end
|
||||
local topLeftControl
|
||||
local bottomLeftControl
|
||||
local bottomRightControl
|
||||
|
||||
local topLeftControl = controlFrame:FindFirstChild("TopLeftControl")
|
||||
local bottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl")
|
||||
local bottomRightControl = controlFrame:FindFirstChild("BottomRightControl")
|
||||
if controlFrame then
|
||||
topLeftControl = controlFrame:FindFirstChild("TopLeftControl")
|
||||
bottomLeftControl = controlFrame:FindFirstChild("BottomLeftControl")
|
||||
bottomRightControl = controlFrame:FindFirstChild("BottomRightControl")
|
||||
else
|
||||
topLeftControl = script.Parent:FindFirstChild("TopLeftControl")
|
||||
bottomLeftControl = script.Parent:FindFirstChild("BottomLeftControl")
|
||||
bottomRightControl = script.Parent:FindFirstChild("BottomRightControl")
|
||||
end
|
||||
|
||||
|
||||
local frameTip = Instance.new("TextLabel")
|
||||
frameTip.Name = "ToolTip"
|
||||
frameTip.Text = ""
|
||||
frameTip.Font = Enum.Font.ArialBold
|
||||
frameTip.FontSize = Enum.FontSize.Size12
|
||||
frameTip.TextColor3 = Color3.new(1,1,1)
|
||||
frameTip.BorderSizePixel = 0
|
||||
frameTip.ZIndex = 10
|
||||
frameTip.Size = UDim2.new(2,0,1,0)
|
||||
frameTip.Position = UDim2.new(1,0,0,0)
|
||||
frameTip.BackgroundColor3 = Color3.new(0,0,0)
|
||||
frameTip.BackgroundTransparency = 1
|
||||
frameTip.TextTransparency = 1
|
||||
frameTip.TextWrap = true
|
||||
local frame = Instance.new("TextLabel")
|
||||
frame.RobloxLocked = true
|
||||
frame.Name = "ToolTip"
|
||||
frame.Text = "Hi! I'm a ToolTip!"
|
||||
frame.Font = Enum.Font.ArialBold
|
||||
frame.FontSize = Enum.FontSize.Size12
|
||||
frame.TextColor3 = Color3.new(1,1,1)
|
||||
frame.BorderSizePixel = 0
|
||||
frame.ZIndex = 10
|
||||
frame.Size = UDim2.new(2,0,1,0)
|
||||
frame.Position = UDim2.new(1,0,0,0)
|
||||
frame.BackgroundColor3 = Color3.new(0,0,0)
|
||||
frame.BackgroundTransparency = 1
|
||||
frame.TextTransparency = 1
|
||||
frame.TextWrap = true
|
||||
|
||||
local inside = Instance.new("BoolValue")
|
||||
inside.RobloxLocked = true
|
||||
inside.Name = "inside"
|
||||
inside.Value = false
|
||||
inside.Parent = frameTip
|
||||
inside.Parent = frame
|
||||
|
||||
function setUpListeners(frameToListen)
|
||||
function setUpListeners(frame)
|
||||
local fadeSpeed = 0.1
|
||||
frameToListen.Parent.MouseEnter:connect(function()
|
||||
if frameToListen:FindFirstChild("inside") then
|
||||
frameToListen.inside.Value = true
|
||||
wait(1.2)
|
||||
if frameToListen.inside.Value then
|
||||
while frameToListen.inside.Value and frameToListen.BackgroundTransparency > 0 do
|
||||
frameToListen.BackgroundTransparency = frameToListen.BackgroundTransparency - fadeSpeed
|
||||
frameToListen.TextTransparency = frameToListen.TextTransparency - fadeSpeed
|
||||
wait()
|
||||
end
|
||||
frame.Parent.MouseEnter:connect(function()
|
||||
frame.inside.Value = true
|
||||
wait(1.2)
|
||||
if frame.inside.Value then
|
||||
while frame.inside.Value and frame.BackgroundTransparency > 0 do
|
||||
frame.BackgroundTransparency = frame.BackgroundTransparency - fadeSpeed
|
||||
frame.TextTransparency = frame.TextTransparency - fadeSpeed
|
||||
wait()
|
||||
end
|
||||
end
|
||||
end)
|
||||
function killTip(killFrame)
|
||||
killFrame.inside.Value = false
|
||||
killFrame.BackgroundTransparency = 1
|
||||
killFrame.TextTransparency = 1
|
||||
end
|
||||
frameToListen.Parent.MouseLeave:connect(function() killTip(frameToListen) end)
|
||||
frameToListen.Parent.MouseButton1Click:connect(function() killTip(frameToListen) end)
|
||||
frame.Parent.MouseLeave:connect(function()
|
||||
frame.inside.Value = false
|
||||
frame.BackgroundTransparency = 1
|
||||
frame.TextTransparency = 1
|
||||
end)
|
||||
frame.Parent.MouseButton1Click:connect(function()
|
||||
frame.inside.Value = false
|
||||
frame.BackgroundTransparency = 1
|
||||
frame.TextTransparency = 1
|
||||
end)
|
||||
end
|
||||
|
||||
function createSettingsButtonTip(parent)
|
||||
if parent == nil then
|
||||
parent = bottomLeftControl:FindFirstChild("SettingsButton")
|
||||
end
|
||||
|
||||
local toolTip = frameTip:clone()
|
||||
toolTip.RobloxLocked = true
|
||||
toolTip.Text = "Settings/Leave Game"
|
||||
toolTip.Position = UDim2.new(0,0,0,-18)
|
||||
toolTip.Size = UDim2.new(0,120,0,20)
|
||||
toolTip.Parent = parent
|
||||
setUpListeners(toolTip)
|
||||
end
|
||||
----------------- set up Top Left Tool Tips --------------------------
|
||||
|
||||
wait(5) -- make sure we are loaded in, won't need tool tips for first 5 seconds anyway
|
||||
if topLeftControl then
|
||||
local topLeftChildren = topLeftControl:GetChildren()
|
||||
|
||||
for i = 1, #topLeftChildren do
|
||||
|
||||
if topLeftChildren[i].Name == "Help" then
|
||||
local helpTip = frame:clone()
|
||||
helpTip.RobloxLocked = true
|
||||
helpTip.Text = "Help"
|
||||
helpTip.Parent = topLeftChildren[i]
|
||||
setUpListeners(helpTip)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
---------------- set up Bottom Left Tool Tips -------------------------
|
||||
|
||||
local bottomLeftChildren = bottomLeftControl:GetChildren()
|
||||
local hasSettingsTip = false
|
||||
|
||||
for i = 1, #bottomLeftChildren do
|
||||
|
||||
if bottomLeftChildren[i].Name == "Exit" then
|
||||
local exitTip = frameTip:clone()
|
||||
local exitTip = frame:clone()
|
||||
exitTip.RobloxLocked = true
|
||||
exitTip.Text = "Leave Place"
|
||||
exitTip.Position = UDim2.new(0,0,-1,0)
|
||||
exitTip.Size = UDim2.new(1,0,1,0)
|
||||
exitTip.Parent = bottomLeftChildren[i]
|
||||
setUpListeners(exitTip)
|
||||
elseif bottomLeftChildren[i].Name == "TogglePlayMode" then
|
||||
local playTip = frame:clone()
|
||||
playTip.RobloxLocked = true
|
||||
playTip.Text = "Roblox Studio"
|
||||
playTip.Position = UDim2.new(0,0,-1,0)
|
||||
playTip.Parent = bottomLeftChildren[i]
|
||||
setUpListeners(playTip)
|
||||
elseif bottomLeftChildren[i].Name == "ToolButton" then
|
||||
local toolTip = frame:clone()
|
||||
toolTip.RobloxLocked = true
|
||||
toolTip.Text = "Build Tools"
|
||||
toolTip.Position = UDim2.new(0,0,-1,0)
|
||||
toolTip.Parent = bottomLeftChildren[i]
|
||||
setUpListeners(toolTip)
|
||||
elseif bottomLeftChildren[i].Name == "SettingsButton" then
|
||||
hasSettingsTip = true
|
||||
createSettingsButtonTip(bottomLeftChildren[i])
|
||||
local toolTip = frame:clone()
|
||||
toolTip.RobloxLocked = true
|
||||
toolTip.Text = "Settings"
|
||||
toolTip.Position = UDim2.new(0,0,-1,0)
|
||||
toolTip.Parent = bottomLeftChildren[i]
|
||||
setUpListeners(toolTip)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -94,8 +125,32 @@ end
|
|||
local bottomRightChildren = bottomRightControl:GetChildren()
|
||||
|
||||
for i = 1, #bottomRightChildren do
|
||||
if bottomRightChildren[i].Name:find("Camera") ~= nil then
|
||||
local cameraTip = frameTip:clone()
|
||||
|
||||
if bottomRightChildren[i].Name == "ToggleFullScreen" then
|
||||
local fullScreen = frame:clone()
|
||||
fullScreen.RobloxLocked = true
|
||||
fullScreen.Text = "Fullscreen"
|
||||
fullScreen.Position = UDim2.new(-1,0,-1,0)
|
||||
fullScreen.Size = UDim2.new(2.4,0,1,0)
|
||||
fullScreen.Parent = bottomRightChildren[i]
|
||||
setUpListeners(fullScreen)
|
||||
elseif bottomRightChildren[i].Name == "ReportAbuse" then
|
||||
local abuseTip = frame:clone()
|
||||
abuseTip.RobloxLocked = true
|
||||
abuseTip.Text = "Report Abuse"
|
||||
abuseTip.Position = UDim2.new(0,0,-1,0)
|
||||
abuseTip.Parent = bottomRightChildren[i]
|
||||
setUpListeners(abuseTip)
|
||||
elseif bottomRightChildren[i].Name == "Screenshot" then
|
||||
local shotTip = frame:clone()
|
||||
shotTip.RobloxLocked = true
|
||||
shotTip.Text = "Screenshot"
|
||||
shotTip.Position = UDim2.new(0,0,-1,0)
|
||||
shotTip.Size = UDim2.new(2.1,0,1,0)
|
||||
shotTip.Parent = bottomRightChildren[i]
|
||||
setUpListeners(shotTip)
|
||||
elseif bottomRightChildren[i].Name:find("Camera") ~= nil then
|
||||
local cameraTip = frame:clone()
|
||||
cameraTip.RobloxLocked = true
|
||||
cameraTip.Text = "Camera View"
|
||||
if bottomRightChildren[i].Name:find("Zoom") then
|
||||
|
|
@ -106,5 +161,24 @@ for i = 1, #bottomRightChildren do
|
|||
cameraTip.Size = UDim2.new(2,0,1.25,0)
|
||||
cameraTip.Parent = bottomRightChildren[i]
|
||||
setUpListeners(cameraTip)
|
||||
elseif bottomRightChildren[i].Name == "RecordToggle" then
|
||||
local recordTip = frame:clone()
|
||||
recordTip.RobloxLocked = true
|
||||
recordTip.Text = "Take Video"
|
||||
recordTip.Position = UDim2.new(0,0,-1.1,0)
|
||||
recordTip.Size = UDim2.new(1,0,1,0)
|
||||
recordTip.Parent = bottomRightChildren[i]
|
||||
setUpListeners(recordTip)
|
||||
elseif bottomRightChildren[i].Name == "Help" then
|
||||
print("found help in bottom right")
|
||||
local helpTip = frame:clone()
|
||||
helpTip.RobloxLocked = true
|
||||
helpTip.Text = "Help"
|
||||
helpTip.Position = UDim2.new(-0.5,0,-1,0)
|
||||
helpTip.Size = UDim2.new(1.5,0,1,0)
|
||||
helpTip.Parent = bottomRightChildren[i]
|
||||
setUpListeners(helpTip)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
1176
public/asset/5
1176
public/asset/5
File diff suppressed because it is too large
Load Diff
|
|
@ -465,54 +465,42 @@ function removeDialog(dialog)
|
|||
end
|
||||
|
||||
function addDialog(dialog)
|
||||
if dialog.Parent then
|
||||
if dialog.Parent:IsA("BasePart") then
|
||||
local chatGui = chatNotificationGui:clone()
|
||||
chatGui.Enabled = not dialog.InUse
|
||||
chatGui.Adornee = dialog.Parent
|
||||
chatGui.RobloxLocked = true
|
||||
chatGui.Parent = game.CoreGui
|
||||
chatGui.Image.Button.MouseButton1Click:connect(function() startDialog(dialog) end)
|
||||
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||
|
||||
dialogMap[dialog] = chatGui
|
||||
if dialog.Parent and dialog.Parent:IsA("BasePart") then
|
||||
local chatGui = chatNotificationGui:clone()
|
||||
chatGui.Enabled = not dialog.InUse
|
||||
chatGui.Adornee = dialog.Parent
|
||||
chatGui.RobloxLocked = true
|
||||
chatGui.Parent = game.CoreGui
|
||||
chatGui.Image.Button.MouseButton1Click:connect(function() startDialog(dialog) end)
|
||||
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||
|
||||
dialogMap[dialog] = chatGui
|
||||
|
||||
dialogConnections[dialog] = dialog.Changed:connect(function(prop)
|
||||
if prop == "Parent" and dialog.Parent then
|
||||
--This handles the reparenting case, seperate from removal case
|
||||
removeDialog(dialog)
|
||||
addDialog(dialog)
|
||||
elseif prop == "InUse" then
|
||||
chatGui.Enabled = not currentConversationDialog and not dialog.InUse
|
||||
if dialog == currentConversationDialog then
|
||||
dialogConnections[dialog] = dialog.Changed:connect(function(prop)
|
||||
if prop == "Parent" and dialog.Parent then
|
||||
--This handles the reparenting case, seperate from removal case
|
||||
removeDialog(dialog)
|
||||
addDialog(dialog)
|
||||
elseif prop == "InUse" then
|
||||
chatGui.Enabled = not currentConversationDialog and not dialog.InUse
|
||||
if dialog == currentConversationDialog then
|
||||
timeoutDialog()
|
||||
end
|
||||
elseif prop == "Tone" or prop == "Purpose" then
|
||||
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||
end
|
||||
end)
|
||||
else -- still need to listen to parent changes even if current parent is not a BasePart
|
||||
dialogConnections[dialog] = dialog.Changed:connect(function(prop)
|
||||
if prop == "Parent" and dialog.Parent then
|
||||
--This handles the reparenting case, seperate from removal case
|
||||
removeDialog(dialog)
|
||||
addDialog(dialog)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
elseif prop == "Tone" or prop == "Purpose" then
|
||||
setChatNotificationTone(chatGui, dialog.Purpose, dialog.Tone)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function fetchScripts()
|
||||
--print("InsertService")
|
||||
local model = game:GetService("InsertService"):LoadAsset(39226062)
|
||||
if type(model) == "string" then -- load failed, lets try again
|
||||
wait(0.1)
|
||||
--print(model)
|
||||
while type(model) == "string" do
|
||||
--print("Trying again to fetch Scripts")
|
||||
model = game:GetService("InsertService"):LoadAsset(39226062)
|
||||
end
|
||||
if type(model) == "string" then -- not going to work, lets bail
|
||||
return
|
||||
end
|
||||
|
||||
waitForChild(model,"TimeoutScript")
|
||||
timeoutScript = model.TimeoutScript
|
||||
waitForChild(model,"ReenableDialogScript")
|
||||
|
|
|
|||
1971
public/asset/7
1971
public/asset/7
File diff suppressed because it is too large
Load Diff
263
public/asset/8
263
public/asset/8
|
|
@ -1,215 +1,66 @@
|
|||
%8%
|
||||
function waitForProperty(instance, property)
|
||||
while not instance[property] do
|
||||
instance.Changed:wait()
|
||||
end
|
||||
end
|
||||
function waitForChild(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
end
|
||||
--build our gui
|
||||
|
||||
waitForProperty(game.Players,"LocalPlayer")
|
||||
waitForChild(script.Parent,"Popup")
|
||||
waitForChild(script.Parent.Popup,"AcceptButton")
|
||||
script.Parent.Popup.AcceptButton.Modal = true
|
||||
local popupFrame = Instance.new("Frame")
|
||||
popupFrame.Position = UDim2.new(0.5,-165,0.5,-175)
|
||||
popupFrame.Size = UDim2.new(0,330,0,350)
|
||||
popupFrame.Style = Enum.FrameStyle.RobloxRound
|
||||
popupFrame.ZIndex = 4
|
||||
popupFrame.Name = "Popup"
|
||||
popupFrame.Visible = false
|
||||
popupFrame.Parent = script.Parent
|
||||
|
||||
local localPlayer = game.Players.LocalPlayer
|
||||
local acceptedTeleport = Instance.new("IntValue")
|
||||
local darken = popupFrame:clone()
|
||||
darken.Size = UDim2.new(1,16,1,16)
|
||||
darken.Position = UDim2.new(0,-8,0,-8)
|
||||
darken.Name = "Darken"
|
||||
darken.ZIndex = 1
|
||||
darken.Parent = popupFrame
|
||||
|
||||
local friendRequestBlacklist = {}
|
||||
local acceptButton = Instance.new("TextButton")
|
||||
acceptButton.Position = UDim2.new(0,20,0,270)
|
||||
acceptButton.Size = UDim2.new(0,100,0,50)
|
||||
acceptButton.Font = Enum.Font.ArialBold
|
||||
acceptButton.FontSize = Enum.FontSize.Size24
|
||||
acceptButton.Style = Enum.ButtonStyle.RobloxButton
|
||||
acceptButton.TextColor3 = Color3.new(248/255,248/255,248/255)
|
||||
acceptButton.Text = "Yes"
|
||||
acceptButton.ZIndex = 5
|
||||
acceptButton.Name = "AcceptButton"
|
||||
acceptButton.Parent = popupFrame
|
||||
|
||||
local teleportEnabled = true
|
||||
local declineButton = acceptButton:clone()
|
||||
declineButton.Position = UDim2.new(1,-120,0,270)
|
||||
declineButton.Text = "No"
|
||||
declineButton.Name = "DeclineButton"
|
||||
declineButton.Parent = popupFrame
|
||||
|
||||
local makePopupInvisible = function()
|
||||
if script.Parent.Popup then script.Parent.Popup.Visible = false end
|
||||
end
|
||||
local popupImage = Instance.new("ImageLabel")
|
||||
popupImage.BackgroundTransparency = 1
|
||||
popupImage.Position = UDim2.new(0.5,-140,0,0)
|
||||
popupImage.Size = UDim2.new(0,280,0,280)
|
||||
popupImage.ZIndex = 3
|
||||
popupImage.Name = "PopupImage"
|
||||
popupImage.Parent = popupFrame
|
||||
|
||||
function makeFriend(fromPlayer,toPlayer)
|
||||
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
if popup == nil then return end -- there is no popup!
|
||||
if popup.Visible then return end -- currently popping something, abort!
|
||||
if friendRequestBlacklist[fromPlayer] then return end -- previously cancelled friend request, we don't want it!
|
||||
local backing = Instance.new("ImageLabel")
|
||||
backing.BackgroundTransparency = 1
|
||||
backing.Size = UDim2.new(1,0,1,0)
|
||||
backing.Image = "http://www.youtube.pengin.xyz/asset/?id=47574181"
|
||||
backing.Name = "Backing"
|
||||
backing.ZIndex = 2
|
||||
backing.Parent = popupImage
|
||||
|
||||
popup.PopupText.Text = "Accept Friend Request from " .. tostring(fromPlayer.Name) .. "?"
|
||||
popup.PopupImage.Image = "http://www.morblox.us/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=352&y=352"
|
||||
|
||||
showTwoButtons()
|
||||
popup.Visible = true
|
||||
popup.AcceptButton.Text = "Accept"
|
||||
popup.DeclineButton.Text = "Decline"
|
||||
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
|
||||
|
||||
local yesCon, noCon
|
||||
local popupText = Instance.new("TextLabel")
|
||||
popupText.Name = "PopupText"
|
||||
popupText.Size = UDim2.new(1,0,0.8,0)
|
||||
popupText.Font = Enum.Font.ArialBold
|
||||
popupText.FontSize = Enum.FontSize.Size36
|
||||
popupText.BackgroundTransparency = 1
|
||||
popupText.Text = "Hello I'm a popup"
|
||||
popupText.TextColor3 = Color3.new(248/255,248/255,248/255)
|
||||
popupText.TextWrap = true
|
||||
popupText.ZIndex = 5
|
||||
popupText.Parent = popupFrame
|
||||
|
||||
yesCon = popup.AcceptButton.MouseButton1Click:connect(function()
|
||||
popup.Visible = false
|
||||
toPlayer:RequestFriendship(fromPlayer)
|
||||
if yesCon then yesCon:disconnect() end
|
||||
if noCon then noCon:disconnect() end
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end)
|
||||
|
||||
noCon = popup.DeclineButton.MouseButton1Click:connect(function()
|
||||
popup.Visible = false
|
||||
toPlayer:RevokeFriendship(fromPlayer)
|
||||
friendRequestBlacklist[fromPlayer] = true
|
||||
print("pop up blacklist")
|
||||
if yesCon then yesCon:disconnect() end
|
||||
if noCon then noCon:disconnect() end
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
game.Players.FriendRequestEvent:connect(function(fromPlayer,toPlayer,event)
|
||||
|
||||
-- if this doesn't involve me, then do nothing
|
||||
if fromPlayer ~= localPlayer and toPlayer ~= localPlayer then return end
|
||||
|
||||
if fromPlayer == localPlayer then
|
||||
if event == Enum.FriendRequestEvent.Accept then
|
||||
game:GetService("GuiService"):SendNotification("You are Friends",
|
||||
"With " .. toPlayer.Name .. "!",
|
||||
"http://www.morblox.us/thumbs/avatar.ashx?userId="..tostring(toPlayer.userId).."&x=48&y=48",
|
||||
5,
|
||||
function()
|
||||
|
||||
end)
|
||||
end
|
||||
elseif toPlayer == localPlayer then
|
||||
if event == Enum.FriendRequestEvent.Issue then
|
||||
if friendRequestBlacklist[fromPlayer] then return end -- previously cancelled friend request, we don't want it!
|
||||
game:GetService("GuiService"):SendNotification("Friend Request",
|
||||
"From " .. fromPlayer.Name,
|
||||
"http://www.morblox.us/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48",
|
||||
8,
|
||||
function()
|
||||
makeFriend(fromPlayer,toPlayer)
|
||||
end)
|
||||
elseif event == Enum.FriendRequestEvent.Accept then
|
||||
game:GetService("GuiService"):SendNotification("You are Friends",
|
||||
"With " .. fromPlayer.Name .. "!",
|
||||
"http://www.morblox.us/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48",
|
||||
5,
|
||||
function()
|
||||
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function showOneButton()
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
if popup then
|
||||
popup.OKButton.Visible = true
|
||||
popup.DeclineButton.Visible = false
|
||||
popup.AcceptButton.Visible = false
|
||||
end
|
||||
end
|
||||
|
||||
function showTwoButtons()
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
if popup then
|
||||
popup.OKButton.Visible = false
|
||||
popup.DeclineButton.Visible = true
|
||||
popup.AcceptButton.Visible = true
|
||||
end
|
||||
end
|
||||
|
||||
if teleportEnabled then
|
||||
game:GetService("TeleportService").ErrorCallback = function(message)
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
showOneButton()
|
||||
popup.PopupText.Text = message
|
||||
local clickCon
|
||||
clickCon = popup.OKButton.MouseButton1Click:connect(function()
|
||||
if clickCon then clickCon:disconnect() end
|
||||
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup"))
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end)
|
||||
game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog,
|
||||
--ShowFunction
|
||||
function()
|
||||
showOneButton()
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
|
||||
end,
|
||||
--HideFunction
|
||||
function()
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end)
|
||||
|
||||
end
|
||||
game:GetService("TeleportService").ConfirmationCallback = function(message, placeId, spawnName)
|
||||
local popup = script.Parent:FindFirstChild("Popup")
|
||||
popup.PopupText.Text = message
|
||||
popup.PopupImage.Image = ""
|
||||
|
||||
local yesCon, noCon
|
||||
|
||||
local function killCons()
|
||||
if yesCon then yesCon:disconnect() end
|
||||
if noCon then noCon:disconnect() end
|
||||
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup"))
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end
|
||||
|
||||
yesCon = popup.AcceptButton.MouseButton1Click:connect(function()
|
||||
killCons()
|
||||
local success, err = pcall(function() game:GetService("TeleportService"):TeleportImpl(placeId,spawnName) end)
|
||||
if not success then
|
||||
showOneButton()
|
||||
popup.PopupText.Text = err
|
||||
local clickCon
|
||||
clickCon = popup.OKButton.MouseButton1Click:connect(function()
|
||||
if clickCon then clickCon:disconnect() end
|
||||
game.GuiService:RemoveCenterDialog(script.Parent:FindFirstChild("Popup"))
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end)
|
||||
game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog,
|
||||
--ShowFunction
|
||||
function()
|
||||
showOneButton()
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
|
||||
end,
|
||||
--HideFunction
|
||||
function()
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
noCon = popup.DeclineButton.MouseButton1Click:connect(function()
|
||||
killCons()
|
||||
local success = pcall(function() game:GetService("TeleportService"):TeleportCancel() end)
|
||||
end)
|
||||
|
||||
local centerDialogSuccess = pcall(function() game.GuiService:AddCenterDialog(script.Parent:FindFirstChild("Popup"), Enum.CenterDialogType.QuitDialog,
|
||||
--ShowFunction
|
||||
function()
|
||||
showTwoButtons()
|
||||
popup.AcceptButton.Text = "Leave"
|
||||
popup.DeclineButton.Text = "Stay"
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
|
||||
end,
|
||||
--HideFunction
|
||||
function()
|
||||
popup:TweenSize(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true,makePopupInvisible())
|
||||
end)
|
||||
end)
|
||||
|
||||
if centerDialogSuccess == false then
|
||||
script.Parent:FindFirstChild("Popup").Visible = true
|
||||
popup.AcceptButton.Text = "Leave"
|
||||
popup.DeclineButton.Text = "Stay"
|
||||
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
|
||||
end
|
||||
return true
|
||||
|
||||
end
|
||||
end
|
||||
script:remove()
|
||||
1003
public/asset/9
1003
public/asset/9
File diff suppressed because it is too large
Load Diff
|
|
@ -43,18 +43,10 @@ if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/asset/" . $id)){
|
|||
sign($file);
|
||||
}else if($id == 14){
|
||||
sign($file);
|
||||
}else if($id == 15){
|
||||
}else if($id == 1000){
|
||||
sign($file);
|
||||
}else if($id == 16){
|
||||
}else if($id == 38037265){
|
||||
sign($file);
|
||||
}else if($id == 17){
|
||||
sign($file);
|
||||
}else if($id == 18){
|
||||
sign($file);
|
||||
}else if($id == 19){
|
||||
sign($file);
|
||||
}else if($id == 20){
|
||||
sign($file);
|
||||
}else{
|
||||
echo $file;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue