parent
4c3282f154
commit
3e5ab8b5c6
106
public/asset/1
106
public/asset/1
|
|
@ -1,10 +1,8 @@
|
|||
%1%
|
||||
%1%
|
||||
-- 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")
|
||||
|
|
@ -27,90 +25,50 @@ scriptContext:AddCoreScript(3, scriptContext, "CoreScripts/Sections")
|
|||
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")
|
||||
end
|
||||
-- ToolTipper (creates tool tips for gui)
|
||||
scriptContext:AddCoreScript(4,screenGui,"CoreScripts/ToolTip")
|
||||
|
||||
-- For Deepak Testing
|
||||
pcall(function()
|
||||
waitForProperty(game,"PlaceId")
|
||||
if game.PlaceId == deepakTestingPlace then
|
||||
scriptContext:AddCoreScript(52177626,screenGui,"RBXStatusBuffsGUIScript")
|
||||
scriptContext:AddCoreScript(52177590,screenGui,"HealthScript v4.0")
|
||||
end
|
||||
end)
|
||||
-- SettingsScript
|
||||
scriptContext:AddCoreScript(5,screenGui,"CoreScripts/Settings")
|
||||
|
||||
-- MainBotChatScript
|
||||
scriptContext:AddCoreScript(6,screenGui,"CoreScripts/MainBotChatScript")
|
||||
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(7,screenGui,"CoreScripts/PlayerListScript")
|
||||
-- Popup Script
|
||||
scriptContext:AddCoreScript(8,screenGui,"CoreScripts/PopupScript")
|
||||
-- Friend Notification Script (probably can use this script to expand out to other notifications)
|
||||
scriptContext:AddCoreScript(9,screenGui,"CoreScripts/NotificationScript")
|
||||
-- Chat script
|
||||
scriptContext:AddCoreScript(1000, screenGui, "CoreScripts/ChatScript")
|
||||
-- Purchase Prompt Script
|
||||
scriptContext:AddCoreScript(10, screenGui, "CoreScripts/PurchasePromptScript")
|
||||
scriptContext:AddCoreScript(10, screenGui, "CoreScripts/ChatScript")
|
||||
|
||||
if not touchEnabled then
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(7,screenGui,"CoreScripts/PlayerListScript")
|
||||
elseif screenGui.AbsoluteSize.Y > 600 then
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(7,screenGui,"CoreScripts/PlayerListScript")
|
||||
else
|
||||
delay(5, function()
|
||||
if screenGui.AbsoluteSize.Y >= 600 then
|
||||
-- New Player List
|
||||
scriptContext:AddCoreScript(7,screenGui,"CoreScripts/PlayerListScript")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if game.CoreGui.Version >= 3 then
|
||||
-- For Deepak Testing
|
||||
pcall(function()
|
||||
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.CurrentLoadout,"TempSlot")
|
||||
waitForChild(screenGui.CurrentLoadout.TempSlot,"SlotNumber")
|
||||
-- Backpack Script
|
||||
scriptContext:AddCoreScript(12,screenGui.CurrentLoadout,"BackpackScript")
|
||||
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")
|
||||
if game.PlaceId == deepakTestingPlace then
|
||||
scriptContext:AddCoreScript(52177626,screenGui,"CoreScripts/RBXStatusBuffsGUIScript")
|
||||
scriptContext:AddCoreScript(52177590,screenGui,"CoreScripts/HealthScript v4.0")
|
||||
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
|
||||
if game.CoreGui.Version >= 3 then
|
||||
-- Backpack Builder, creates most of the backpack gui
|
||||
scriptContext:AddCoreScript(11,screenGui,"CoreScripts/BackpackScripts/BackpackBuilder")
|
||||
|
||||
waitForChild(screenGui.ControlFrame, 'TopLeftControl')
|
||||
screenGui.ControlFrame.TopLeftControl.Visible = false
|
||||
end
|
||||
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(12,Backpack,"CoreScripts/BackpackScripts/BackpackManager")
|
||||
end
|
||||
|
||||
-- Backpack Gear (handles all backpack gear tab stuff)
|
||||
game:GetService("ScriptContext"):AddCoreScript(13,Backpack,"CoreScripts/BackpackScripts/BackpackGear")
|
||||
-- Loadout Script, used for gear hotkeys
|
||||
scriptContext:AddCoreScript(14,screenGui.CurrentLoadout,"CoreScripts/BackpackScripts/LoadoutScript")
|
||||
-- Wardrobe script handles all character dressing operations
|
||||
scriptContext:AddCoreScript(4336,Backpack,"CoreScripts/BackpackScripts/BackpackWardrobe")
|
||||
end
|
||||
1416
public/asset/10
1416
public/asset/10
File diff suppressed because it is too large
Load Diff
1719
public/asset/11
1719
public/asset/11
File diff suppressed because it is too large
Load Diff
1191
public/asset/12
1191
public/asset/12
File diff suppressed because it is too large
Load Diff
3925
public/asset/13
3925
public/asset/13
File diff suppressed because it is too large
Load Diff
904
public/asset/14
904
public/asset/14
|
|
@ -1,24 +1,880 @@
|
|||
%14%
|
||||
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
|
||||
%14%
|
||||
if game.CoreGui.Version < 3 then return end -- peace out if we aren't using the right client
|
||||
|
||||
-- A couple of necessary functions
|
||||
local function waitForChild(instance, name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
instance.ChildAdded:wait()
|
||||
end
|
||||
return instance:FindFirstChild(name)
|
||||
end
|
||||
local function waitForProperty(instance, property)
|
||||
while not instance[property] do
|
||||
instance.Changed:wait()
|
||||
end
|
||||
end
|
||||
|
||||
local currentLoadout = script.Parent
|
||||
local StaticTabName = "gear"
|
||||
|
||||
local robloxGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
|
||||
assert(robloxGui)
|
||||
waitForChild(robloxGui,"CurrentLoadout")
|
||||
waitForChild(robloxGui.CurrentLoadout,"TempSlot")
|
||||
waitForChild(robloxGui.CurrentLoadout.TempSlot,"SlotNumber")
|
||||
|
||||
|
||||
--- Begin Locals
|
||||
waitForChild(game,"Players")
|
||||
waitForProperty(game.Players,"LocalPlayer")
|
||||
local player = game.Players.LocalPlayer
|
||||
|
||||
waitForChild(game, "LocalBackpack")
|
||||
game.LocalBackpack:SetOldSchoolBackpack(false)
|
||||
|
||||
waitForChild(currentLoadout.Parent,"Backpack")
|
||||
local guiBackpack = currentLoadout.Parent.Backpack
|
||||
|
||||
local backpackManager = waitForChild(guiBackpack,"CoreScripts/BackpackScripts/BackpackManager")
|
||||
local backpackOpenEvent = waitForChild(backpackManager,"BackpackOpenEvent")
|
||||
local backpackCloseEvent = waitForChild(backpackManager,"BackpackCloseEvent")
|
||||
local tabClickedEvent = waitForChild(backpackManager,"TabClickedEvent")
|
||||
local resizeEvent = waitForChild(backpackManager,"ResizeEvent")
|
||||
|
||||
local inGearTab = true
|
||||
|
||||
local maxNumLoadoutItems = 10
|
||||
|
||||
local characterChildAddedCon = nil
|
||||
local backpackChildCon = nil
|
||||
|
||||
local debounce = false
|
||||
|
||||
local enlargeFactor = 1.18
|
||||
local buttonSizeEnlarge = UDim2.new(1 * enlargeFactor,0,1 * enlargeFactor,0)
|
||||
local buttonSizeNormal = UDim2.new(1,0,1,0)
|
||||
local enlargeOverride = true
|
||||
local guiTweenSpeed = 0.5
|
||||
|
||||
local inventory = {}
|
||||
|
||||
for i = 0, 9 do
|
||||
game:GetService("GuiService"):AddKey(tostring(i)) -- register our keys
|
||||
end
|
||||
|
||||
local gearSlots = {}
|
||||
for i = 1, maxNumLoadoutItems do
|
||||
gearSlots[i] = "empty"
|
||||
end
|
||||
--- End Locals
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Begin Functions
|
||||
local function kill(prop,con,gear)
|
||||
if con then con:disconnect() end
|
||||
if prop == true and gear then
|
||||
reorganizeLoadout(gear,false)
|
||||
end
|
||||
end
|
||||
|
||||
function characterInWorkspace()
|
||||
if game.Players["LocalPlayer"] then
|
||||
if game.Players.LocalPlayer["Character"] then
|
||||
if game.Players.LocalPlayer.Character ~= nil then
|
||||
if game.Players.LocalPlayer.Character.Parent ~= nil then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function removeGear(gear)
|
||||
local emptySlot = nil
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] == gear and gear.Parent ~= nil then
|
||||
emptySlot = i
|
||||
break
|
||||
end
|
||||
end
|
||||
if emptySlot then
|
||||
if gearSlots[emptySlot].GearReference.Value then
|
||||
if gearSlots[emptySlot].GearReference.Value.Parent == game.Players.LocalPlayer.Character then -- if we currently have this equipped, unequip it
|
||||
gearSlots[emptySlot].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
|
||||
end
|
||||
|
||||
if gearSlots[emptySlot].GearReference.Value:IsA("HopperBin") and gearSlots[emptySlot].GearReference.Value.Active then -- this is an active hopperbin
|
||||
gearSlots[emptySlot].GearReference.Value:Disable()
|
||||
gearSlots[emptySlot].GearReference.Value.Active = false
|
||||
end
|
||||
end
|
||||
|
||||
gearSlots[emptySlot] = "empty"
|
||||
|
||||
local centerizeX = gear.Size.X.Scale/2
|
||||
local centerizeY = gear.Size.Y.Scale/2
|
||||
gear:TweenSizeAndPosition(UDim2.new(0,0,0,0),
|
||||
UDim2.new(gear.Position.X.Scale + centerizeX,gear.Position.X.Offset,gear.Position.Y.Scale + centerizeY,gear.Position.Y.Offset),
|
||||
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/4,true)
|
||||
delay(guiTweenSpeed/2,
|
||||
function()
|
||||
gear:remove()
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function insertGear(gear, addToSlot)
|
||||
local pos = nil
|
||||
if not addToSlot then
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] == "empty" then
|
||||
pos = i
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if pos == 1 and gearSlots[1] ~= "empty" then gear:remove() return end -- we are currently full, can't add in
|
||||
else
|
||||
pos = addToSlot
|
||||
-- push all gear down one slot
|
||||
local start = 1
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] == "empty" then
|
||||
start = i
|
||||
break
|
||||
end
|
||||
end
|
||||
for i = start, pos + 1, -1 do
|
||||
gearSlots[i] = gearSlots[i - 1]
|
||||
if i == 10 then
|
||||
gearSlots[i].SlotNumber.Text = "0"
|
||||
gearSlots[i].SlotNumberDownShadow.Text = "0"
|
||||
gearSlots[i].SlotNumberUpShadow.Text = "0"
|
||||
else
|
||||
gearSlots[i].SlotNumber.Text = i
|
||||
gearSlots[i].SlotNumberDownShadow.Text = i
|
||||
gearSlots[i].SlotNumberUpShadow.Text = i
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
gearSlots[pos] = gear
|
||||
if pos ~= maxNumLoadoutItems then
|
||||
if(type(tostring(pos)) == "string") then
|
||||
local posString = tostring(pos)
|
||||
gear.SlotNumber.Text = posString
|
||||
gear.SlotNumberDownShadow.Text = posString
|
||||
gear.SlotNumberUpShadow.Text = posString
|
||||
end
|
||||
else -- tenth gear doesn't follow mathematical pattern :(
|
||||
gear.SlotNumber.Text = "0"
|
||||
gear.SlotNumberDownShadow.Text = "0"
|
||||
gear.SlotNumberUpShadow.Text = "0"
|
||||
end
|
||||
gear.Visible = true
|
||||
|
||||
local con = nil
|
||||
con = gear.Kill.Changed:connect(function(prop) kill(prop,con,gear) end)
|
||||
end
|
||||
|
||||
|
||||
function reorganizeLoadout(gear, inserting, equipped, addToSlot)
|
||||
if inserting then -- add in gear
|
||||
insertGear(gear, addToSlot)
|
||||
else
|
||||
removeGear(gear)
|
||||
end
|
||||
if gear ~= "empty" then gear.ZIndex = 1 end
|
||||
end
|
||||
|
||||
function checkToolAncestry(child,parent)
|
||||
if child:FindFirstChild("RobloxBuildTool") then return end -- don't show roblox build tools
|
||||
if child:IsA("Tool") or child:IsA("HopperBin") then
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then
|
||||
if parent == nil then
|
||||
gearSlots[i].Kill.Value = true
|
||||
return false
|
||||
elseif child.Parent == player.Character then
|
||||
gearSlots[i].Selected = true
|
||||
return true
|
||||
elseif child.Parent == player.Backpack then
|
||||
if child:IsA("Tool") or child:IsA("HopperBin") then gearSlots[i].Selected = false end
|
||||
return true
|
||||
else
|
||||
gearSlots[i].Kill.Value = true
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
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
|
||||
if stuff[i]:IsA("Tool") then stuff[i].Parent = player.Backpack end
|
||||
if stuff[i]:IsA("HopperBin") then
|
||||
stuff[i]:Disable()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function hopperBinSwitcher(numKey, physGear)
|
||||
if not physGear then return end
|
||||
|
||||
physGear:ToggleSelect()
|
||||
|
||||
if gearSlots[numKey] == "empty" then return end
|
||||
|
||||
if not physGear.Active then
|
||||
gearSlots[numKey].Selected = false
|
||||
normalizeButton(gearSlots[numKey])
|
||||
else
|
||||
gearSlots[numKey].Selected = true
|
||||
enlargeButton(gearSlots[numKey])
|
||||
end
|
||||
end
|
||||
|
||||
function toolSwitcher(numKey)
|
||||
|
||||
if not gearSlots[numKey] then return end
|
||||
local physGear = gearSlots[numKey].GearReference.Value
|
||||
if physGear == nil then return end
|
||||
|
||||
removeAllEquippedGear(physGear) -- we don't remove this gear, as then we get a double switcheroo
|
||||
|
||||
local key = numKey
|
||||
if numKey == 0 then key = 10 end
|
||||
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] and gearSlots[i] ~= "empty" and i ~= key then
|
||||
normalizeButton(gearSlots[i])
|
||||
gearSlots[i].Selected = false
|
||||
if gearSlots[i].GearReference and gearSlots[i].GearReference.Value and gearSlots[i].GearReference.Value:IsA("HopperBin") and gearSlots[i].GearReference.Value.Active then
|
||||
gearSlots[i].GearReference.Value:ToggleSelect()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if physGear:IsA("HopperBin") then
|
||||
hopperBinSwitcher(numKey,physGear)
|
||||
else
|
||||
if physGear.Parent == player.Character then
|
||||
physGear.Parent = player.Backpack
|
||||
|
||||
if gearSlots[numKey] ~= "empty" then
|
||||
gearSlots[numKey].Selected = false
|
||||
normalizeButton(gearSlots[numKey])
|
||||
end
|
||||
else
|
||||
--player.Character.Humanoid:EquipTool(physGear)
|
||||
|
||||
physGear.Parent = player.Character
|
||||
gearSlots[numKey].Selected = true
|
||||
|
||||
enlargeButton(gearSlots[numKey])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function activateGear(num)
|
||||
local numKey = nil
|
||||
if num == "0" then
|
||||
numKey = 10 -- why do lua indexes have to start at 1? :(
|
||||
else
|
||||
numKey = tonumber(num)
|
||||
end
|
||||
|
||||
if(numKey == nil) then return end
|
||||
|
||||
if gearSlots[numKey] ~= "empty" then
|
||||
toolSwitcher(numKey)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
enlargeButton = function(button)
|
||||
if button.Size.Y.Scale > 1 then return end
|
||||
if not button.Parent then return end
|
||||
if not button.Selected then return end
|
||||
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] == "empty" then break end
|
||||
if gearSlots[i] ~= button then
|
||||
normalizeButton(gearSlots[i])
|
||||
end
|
||||
end
|
||||
|
||||
if not enlargeOverride then
|
||||
return
|
||||
end
|
||||
|
||||
if button:IsA("ImageButton") or button:IsA("TextButton") then
|
||||
button.ZIndex = 2
|
||||
local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale)/2
|
||||
local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale)/2
|
||||
button:TweenSizeAndPosition(buttonSizeEnlarge,
|
||||
UDim2.new(button.Position.X.Scale + centerizeX,button.Position.X.Offset,button.Position.Y.Scale + centerizeY,button.Position.Y.Offset),
|
||||
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/5,enlargeOverride)
|
||||
end
|
||||
end
|
||||
|
||||
normalizeAllButtons = function()
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] == "empty" then break end
|
||||
if gearSlots[i] ~= button then
|
||||
normalizeButton(gearSlots[i],0.1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
normalizeButton = function(button, speed)
|
||||
if not button then return end
|
||||
if button.Size.Y.Scale <= 1 then return end
|
||||
if button.Selected then return end
|
||||
if not button.Parent then return end
|
||||
|
||||
local moveSpeed = speed
|
||||
if moveSpeed == nil or type(moveSpeed) ~= "number" then moveSpeed = guiTweenSpeed/5 end
|
||||
|
||||
if button:IsA("ImageButton") or button:IsA("TextButton") then
|
||||
button.ZIndex = 1
|
||||
local inverseEnlarge = 1/enlargeFactor
|
||||
local centerizeX = -(buttonSizeNormal.X.Scale - button.Size.X.Scale)/2
|
||||
local centerizeY = -(buttonSizeNormal.Y.Scale - button.Size.Y.Scale)/2
|
||||
button:TweenSizeAndPosition(buttonSizeNormal,
|
||||
UDim2.new(button.Position.X.Scale + centerizeX,button.Position.X.Offset,button.Position.Y.Scale + centerizeY,button.Position.Y.Offset),
|
||||
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,moveSpeed,enlargeOverride)
|
||||
end
|
||||
end
|
||||
|
||||
local waitForDebounce = function()
|
||||
while debounce do
|
||||
wait()
|
||||
end
|
||||
end
|
||||
|
||||
function pointInRectangle(point,rectTopLeft,rectSize)
|
||||
if point.x > rectTopLeft.x and point.x < (rectTopLeft.x + rectSize.x) then
|
||||
if point.y > rectTopLeft.y and point.y < (rectTopLeft.y + rectSize.y) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function swapGear(gearClone,toFrame)
|
||||
local toFrameChildren = toFrame:GetChildren()
|
||||
if #toFrameChildren == 1 then
|
||||
if toFrameChildren[1]:FindFirstChild("SlotNumber") then
|
||||
|
||||
local toSlot = tonumber(toFrameChildren[1].SlotNumber.Text)
|
||||
local gearCloneSlot = tonumber(gearClone.SlotNumber.Text)
|
||||
if toSlot == 0 then toSlot = 10 end
|
||||
if gearCloneSlot == 0 then gearCloneSlot = 10 end
|
||||
|
||||
gearSlots[toSlot] = gearClone
|
||||
gearSlots[gearCloneSlot] = toFrameChildren[1]
|
||||
|
||||
toFrameChildren[1].SlotNumber.Text = gearClone.SlotNumber.Text
|
||||
toFrameChildren[1].SlotNumberDownShadow.Text = gearClone.SlotNumber.Text
|
||||
toFrameChildren[1].SlotNumberUpShadow.Text = gearClone.SlotNumber.Text
|
||||
|
||||
local subString = string.sub(toFrame.Name,5)
|
||||
gearClone.SlotNumber.Text = subString
|
||||
gearClone.SlotNumberDownShadow.Text = subString
|
||||
gearClone.SlotNumberUpShadow.Text = subString
|
||||
|
||||
gearClone.Position = UDim2.new(gearClone.Position.X.Scale,0,gearClone.Position.Y.Scale,0)
|
||||
toFrameChildren[1].Position = UDim2.new(toFrameChildren[1].Position.X.Scale,0,toFrameChildren[1].Position.Y.Scale,0)
|
||||
|
||||
toFrameChildren[1].Parent = gearClone.Parent
|
||||
gearClone.Parent = toFrame
|
||||
end
|
||||
else
|
||||
local slotNum = tonumber(gearClone.SlotNumber.Text)
|
||||
if slotNum == 0 then slotNum = 10 end
|
||||
gearSlots[slotNum] = "empty" -- reset this gear slot
|
||||
|
||||
local subString = string.sub(toFrame.Name,5)
|
||||
gearClone.SlotNumber.Text = subString
|
||||
gearClone.SlotNumberDownShadow.Text = subString
|
||||
gearClone.SlotNumberUpShadow.Text = subString
|
||||
|
||||
local toSlotNum = tonumber(gearClone.SlotNumber.Text)
|
||||
if toSlotNum == 0 then toSlotNum = 10 end
|
||||
gearSlots[toSlotNum] = gearClone
|
||||
gearClone.Position = UDim2.new(gearClone.Position.X.Scale,0,gearClone.Position.Y.Scale,0)
|
||||
gearClone.Parent = toFrame
|
||||
end
|
||||
end
|
||||
|
||||
function resolveDrag(gearClone,x,y)
|
||||
local mousePoint = Vector2.new(x,y)
|
||||
|
||||
local frame = gearClone.Parent
|
||||
local frames = frame.Parent:GetChildren()
|
||||
|
||||
for i = 1, #frames do
|
||||
if frames[i]:IsA("Frame") then
|
||||
if pointInRectangle(mousePoint, frames[i].AbsolutePosition,frames[i].AbsoluteSize) then
|
||||
swapGear(gearClone,frames[i])
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if x < frame.AbsolutePosition.x or x > ( frame.AbsolutePosition.x + frame.AbsoluteSize.x ) then
|
||||
reorganizeLoadout(gearClone,false)
|
||||
return false
|
||||
elseif y < frame.AbsolutePosition.y or y > ( frame.AbsolutePosition.y + frame.AbsoluteSize.y ) then
|
||||
reorganizeLoadout(gearClone,false)
|
||||
return false
|
||||
else
|
||||
if dragBeginPos then gearClone.Position = dragBeginPos end
|
||||
return -1
|
||||
end
|
||||
end
|
||||
|
||||
function unequipAllItems(dontEquipThis)
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] == "empty" then break end
|
||||
if gearSlots[i].GearReference.Value and gearSlots[i].GearReference.Value ~= dontEquipThis then
|
||||
if gearSlots[i].GearReference.Value:IsA("HopperBin") then
|
||||
gearSlots[i].GearReference.Value:Disable()
|
||||
elseif gearSlots[i].GearReference.Value:IsA("Tool") then
|
||||
gearSlots[i].GearReference.Value.Parent = game.Players.LocalPlayer.Backpack
|
||||
end
|
||||
gearSlots[i].Selected = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function showToolTip(button, tip)
|
||||
if button and button:FindFirstChild("ToolTipLabel") and button.ToolTipLabel:IsA("TextLabel") then
|
||||
button.ToolTipLabel.Text = tostring(tip)
|
||||
local xSize = button.ToolTipLabel.TextBounds.X + 6
|
||||
button.ToolTipLabel.Size = UDim2.new(0,xSize,0,20)
|
||||
button.ToolTipLabel.Position = UDim2.new(0.5,-xSize/2,0,-30)
|
||||
button.ToolTipLabel.Visible = true
|
||||
end
|
||||
end
|
||||
|
||||
function hideToolTip(button, tip)
|
||||
if button and button:FindFirstChild("ToolTipLabel") and button.ToolTipLabel:IsA("TextLabel") then
|
||||
button.ToolTipLabel.Visible = false
|
||||
end
|
||||
end
|
||||
|
||||
local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton)
|
||||
waitForDebounce()
|
||||
debounce = true
|
||||
|
||||
if child:FindFirstChild("RobloxBuildTool") then debounce = false return end -- don't show roblox build tools
|
||||
if not child:IsA("Tool") then
|
||||
if not child:IsA("HopperBin") then
|
||||
debounce = false
|
||||
return -- we don't care about anything besides tools (sigh...)
|
||||
end
|
||||
end
|
||||
|
||||
if not addToSlot then
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing
|
||||
debounce = false
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local gearClone = currentLoadout.TempSlot:clone()
|
||||
gearClone.Name = child.Name
|
||||
gearClone.GearImage.Image = child.TextureId
|
||||
if gearClone.GearImage.Image == "" then
|
||||
gearClone.GearText.Text = child.Name
|
||||
end
|
||||
gearClone.GearReference.Value = child
|
||||
|
||||
gearClone.MouseEnter:connect(function()
|
||||
if gearClone.GearReference and gearClone.GearReference.Value["ToolTip"] and gearClone.GearReference.Value.ToolTip ~= "" then
|
||||
showToolTip(gearClone, gearClone.GearReference.Value.ToolTip)
|
||||
end
|
||||
end)
|
||||
|
||||
gearClone.MouseLeave:connect(function()
|
||||
if gearClone.GearReference and gearClone.GearReference.Value["ToolTip"] and gearClone.GearReference.Value.ToolTip ~= "" then
|
||||
hideToolTip(gearClone, gearClone.GearReference.Value.ToolTip)
|
||||
end
|
||||
end)
|
||||
|
||||
gearClone.RobloxLocked = true
|
||||
|
||||
local slotToMod = -1
|
||||
|
||||
if not addToSlot then
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] == "empty" then
|
||||
slotToMod = i
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
slotToMod = addToSlot
|
||||
end
|
||||
|
||||
if slotToMod == - 1 then -- No available slot to add in!
|
||||
debounce = false
|
||||
return
|
||||
end
|
||||
|
||||
local slotNum = slotToMod % 10
|
||||
local parent = currentLoadout:FindFirstChild("Slot"..tostring(slotNum))
|
||||
gearClone.Parent = parent
|
||||
|
||||
if inventoryGearButton then
|
||||
local absolutePositionFinal = inventoryGearButton.AbsolutePosition
|
||||
local currentAbsolutePosition = gearClone.AbsolutePosition
|
||||
local diff = absolutePositionFinal - currentAbsolutePosition
|
||||
gearClone.Position = UDim2.new(gearClone.Position.X.Scale,diff.x,gearClone.Position.Y.Scale,diff.y)
|
||||
gearClone.ZIndex = 4
|
||||
end
|
||||
|
||||
if addToSlot then
|
||||
reorganizeLoadout(gearClone, true, equipped, addToSlot)
|
||||
else
|
||||
reorganizeLoadout(gearClone, true)
|
||||
end
|
||||
|
||||
if gearClone.Parent == nil then debounce = false return end -- couldn't fit in (hopper is full!)
|
||||
|
||||
if equipped then
|
||||
gearClone.Selected = true
|
||||
unequipAllItems(child)
|
||||
delay(guiTweenSpeed + 0.01,function() -- if our gear is equipped, we will want to enlarge it when done moving
|
||||
if gearClone:FindFirstChild("GearReference") and ( (gearClone.GearReference.Value:IsA("Tool") and gearClone.GearReference.Value.Parent == player.Character) or
|
||||
(gearClone.GearReference.Value:IsA("HopperBin") and gearClone.GearReference.Value.Active == true) ) then
|
||||
enlargeButton(gearClone)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
local dragBeginPos = nil
|
||||
local clickCon, buttonDeleteCon, mouseEnterCon, mouseLeaveCon, dragStop, dragBegin = nil
|
||||
clickCon = gearClone.MouseButton1Click:connect(function()
|
||||
if characterInWorkspace() then
|
||||
if not gearClone.Draggable then
|
||||
activateGear(gearClone.SlotNumber.Text)
|
||||
end
|
||||
end
|
||||
end)
|
||||
mouseEnterCon = gearClone.MouseEnter:connect(function()
|
||||
if guiBackpack.Visible then
|
||||
gearClone.Draggable = true
|
||||
end
|
||||
end)
|
||||
dragBegin = gearClone.DragBegin:connect(function(pos)
|
||||
dragBeginPos = pos
|
||||
gearClone.ZIndex = 7
|
||||
local children = gearClone:GetChildren()
|
||||
for i = 1, #children do
|
||||
if children[i]:IsA("TextLabel") then
|
||||
if string.find(children[i].Name,"Shadow") then
|
||||
children[i].ZIndex = 8
|
||||
else
|
||||
children[i].ZIndex = 9
|
||||
end
|
||||
elseif children[i]:IsA("Frame") or children[i]:IsA("ImageLabel") then
|
||||
children[i].ZIndex = 7
|
||||
end
|
||||
end
|
||||
end)
|
||||
dragStop = gearClone.DragStopped:connect(function(x,y)
|
||||
if gearClone.Selected then
|
||||
gearClone.ZIndex = 2
|
||||
else
|
||||
gearClone.ZIndex = 1
|
||||
end
|
||||
local children = gearClone:GetChildren()
|
||||
for i = 1, #children do
|
||||
if children[i]:IsA("TextLabel") then
|
||||
if string.find(children[i].Name,"Shadow") then
|
||||
children[i].ZIndex = 3
|
||||
else
|
||||
children[i].ZIndex = 4
|
||||
end
|
||||
elseif children[i]:IsA("Frame") or children[i]:IsA("ImageLabel") then
|
||||
children[i].ZIndex = 2
|
||||
end
|
||||
end
|
||||
resolveDrag(gearClone,x,y)
|
||||
end)
|
||||
mouseLeaveCon = gearClone.MouseLeave:connect(function()
|
||||
gearClone.Draggable = false
|
||||
end)
|
||||
buttonDeleteCon = gearClone.AncestryChanged:connect(function()
|
||||
if gearClone.Parent and gearClone.Parent.Parent == currentLoadout then return end
|
||||
if clickCon then clickCon:disconnect() end
|
||||
if buttonDeleteCon then buttonDeleteCon:disconnect() end
|
||||
if mouseEnterCon then mouseEnterCon:disconnect() end
|
||||
if mouseLeaveCon then mouseLeaveCon:disconnect() end
|
||||
if dragStop then dragStop:disconnect() end
|
||||
if dragBegin then dragBegin:disconnect() end
|
||||
end) -- this probably isn't necessary since objects are being deleted (probably), but this might still leak just in case
|
||||
|
||||
local childCon = nil
|
||||
local childChangeCon = nil
|
||||
childCon = child.AncestryChanged:connect(function(newChild,parent)
|
||||
if not checkToolAncestry(newChild,parent) then
|
||||
if childCon then childCon:disconnect() end
|
||||
if childChangeCon then childChangeCon:disconnect() end
|
||||
removeFromInventory(child)
|
||||
elseif parent == game.Players.LocalPlayer.Backpack then
|
||||
normalizeButton(gearClone)
|
||||
end
|
||||
end)
|
||||
|
||||
childChangeCon = child.Changed:connect(function(prop)
|
||||
if prop == "Name" then
|
||||
if gearClone and gearClone.GearImage.Image == "" then
|
||||
gearClone.GearText.Text = child.Name
|
||||
end
|
||||
elseif prop == "Active" then
|
||||
if child and child:IsA("HopperBin") then
|
||||
if not child.Active then
|
||||
gearClone.Selected = false
|
||||
normalizeButton(gearClone)
|
||||
end
|
||||
end
|
||||
elseif prop == "TextureId" then
|
||||
gearClone.GearImage.Image = child.TextureId
|
||||
end
|
||||
end)
|
||||
|
||||
debounce = false
|
||||
|
||||
end
|
||||
|
||||
function addToInventory(child)
|
||||
if not child:IsA("Tool") or not child:IsA("HopperBin") then return end
|
||||
|
||||
local slot = nil
|
||||
for i = 1, #inventory do
|
||||
if inventory[i] and inventory[i] == child then return end
|
||||
if not inventory[i] then slot = i end
|
||||
end
|
||||
if slot then
|
||||
inventory[slot] = child
|
||||
elseif #inventory < 1 then
|
||||
inventory[1] = child
|
||||
else
|
||||
inventory[#inventory + 1] = child
|
||||
end
|
||||
end
|
||||
|
||||
function removeFromInventory(child)
|
||||
for i = 1, #inventory do
|
||||
if inventory[i] == child then
|
||||
table.remove(inventory,i)
|
||||
inventory[i] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local spreadOutGear = function()
|
||||
loadoutChildren = currentLoadout:GetChildren()
|
||||
|
||||
for i = 1, #loadoutChildren do
|
||||
if loadoutChildren[i]:IsA("Frame") then
|
||||
loadoutChildren[i].BackgroundTransparency = 0.5
|
||||
local slot = tonumber(string.sub(loadoutChildren[i].Name,5))
|
||||
if slot == 0 then slot = 10 end
|
||||
loadoutChildren[i]:TweenPosition(UDim2.new((slot - 1)/10,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local centerGear = function()
|
||||
loadoutChildren = currentLoadout:GetChildren()
|
||||
local gearButtons = {}
|
||||
local lastSlotAdd = nlii
|
||||
|
||||
for i = 1, #loadoutChildren do
|
||||
if loadoutChildren[i]:IsA("Frame") then
|
||||
if #loadoutChildren[i]:GetChildren() > 0 then
|
||||
if loadoutChildren[i].Name == "Slot0" then
|
||||
lastSlotAdd = loadoutChildren[i]
|
||||
else
|
||||
table.insert(gearButtons, loadoutChildren[i])
|
||||
end
|
||||
end
|
||||
loadoutChildren[i].BackgroundTransparency = 1
|
||||
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 editLoadout()
|
||||
if inGearTab then
|
||||
spreadOutGear()
|
||||
end
|
||||
end
|
||||
|
||||
function readonlyLoadout()
|
||||
if not inGearTab then
|
||||
centerGear()
|
||||
end
|
||||
end
|
||||
|
||||
function setupBackpackListener()
|
||||
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
||||
backpackChildCon = player.Backpack.ChildAdded:connect(function(child)
|
||||
addingPlayerChild(child)
|
||||
addToInventory(child)
|
||||
end)
|
||||
end
|
||||
|
||||
function playerCharacterChildAdded(child)
|
||||
addingPlayerChild(child,true)
|
||||
addToInventory(child)
|
||||
end
|
||||
|
||||
function activateLoadout()
|
||||
currentLoadout.Visible = true
|
||||
end
|
||||
|
||||
function deactivateLoadout()
|
||||
currentLoadout.Visible = false
|
||||
end
|
||||
|
||||
function tabHandler(inFocus)
|
||||
inGearTab = inFocus
|
||||
if inFocus then
|
||||
editLoadout()
|
||||
else
|
||||
readonlyLoadout()
|
||||
end
|
||||
end
|
||||
-- End Functions
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Begin Script
|
||||
wait() -- let stuff initialize incase this is first heartbeat...
|
||||
|
||||
waitForChild(player,"Backpack")
|
||||
waitForProperty(player,"Character")
|
||||
local backpackChildren = player.Backpack:GetChildren()
|
||||
local size = math.min(10,#backpackChildren)
|
||||
for i = 1, size do
|
||||
addingPlayerChild(backpackChildren[i],false)
|
||||
end
|
||||
setupBackpackListener()
|
||||
|
||||
waitForProperty(player,"Character")
|
||||
for i,v in ipairs(player.Character:GetChildren()) do
|
||||
playerCharacterChildAdded(v)
|
||||
end
|
||||
characterChildAddedCon = player.Character.ChildAdded:connect(function(child) playerCharacterChildAdded(child) end)
|
||||
|
||||
waitForChild(player.Character,"Humanoid")
|
||||
humanoidDiedCon = player.Character.Humanoid.Died:connect(function()
|
||||
if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end
|
||||
deactivateLoadout()
|
||||
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
||||
end)
|
||||
|
||||
player.CharacterRemoving:connect(function()
|
||||
for i = 1, #gearSlots do
|
||||
if gearSlots[i] ~= "empty" then
|
||||
gearSlots[i].Parent = nil
|
||||
gearSlots[i] = "empty"
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
player.CharacterAdded:connect(function()
|
||||
waitForProperty(game.Players,"LocalPlayer")
|
||||
player = game.Players.LocalPlayer -- make sure we are still looking at the correct character
|
||||
waitForChild(player,"Backpack")
|
||||
|
||||
|
||||
delay(1,function()
|
||||
local backpackChildren = player.Backpack:GetChildren()
|
||||
local size = math.min(10,#backpackChildren)
|
||||
for i = 1, size do
|
||||
addingPlayerChild(backpackChildren[i],false)
|
||||
end
|
||||
setupBackpackListener()
|
||||
end)
|
||||
|
||||
activateLoadout()
|
||||
|
||||
if characterChildAddedCon then
|
||||
characterChildAddedCon:disconnect()
|
||||
characterChildAddedCon = nil
|
||||
end
|
||||
|
||||
characterChildAddedCon =
|
||||
player.Character.ChildAdded:connect(function(child)
|
||||
addingPlayerChild(child,true)
|
||||
end)
|
||||
|
||||
waitForChild(player.Character,"Humanoid")
|
||||
humanoidDiedCon =
|
||||
player.Character.Humanoid.Died:connect(function()
|
||||
deactivateLoadout()
|
||||
|
||||
if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end
|
||||
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
waitForChild(guiBackpack,"SwapSlot")
|
||||
guiBackpack.SwapSlot.Changed:connect(function()
|
||||
if guiBackpack.SwapSlot.Value then
|
||||
local swapSlot = guiBackpack.SwapSlot
|
||||
local pos = swapSlot.Slot.Value
|
||||
if pos == 0 then pos = 10 end
|
||||
if gearSlots[pos] then
|
||||
reorganizeLoadout(gearSlots[pos],false)
|
||||
end
|
||||
if swapSlot.GearButton.Value then
|
||||
addingPlayerChild(swapSlot.GearButton.Value.GearReference.Value,false,pos)
|
||||
end
|
||||
guiBackpack.SwapSlot.Value = false
|
||||
end
|
||||
end)
|
||||
|
||||
game:GetService("GuiService").KeyPressed:connect(function(key)
|
||||
if characterInWorkspace() then
|
||||
activateGear(key)
|
||||
end
|
||||
end)
|
||||
|
||||
backpackOpenEvent.Event:connect(editLoadout)
|
||||
backpackCloseEvent.Event:connect(centerGear)
|
||||
tabClickedEvent.Event:connect(function ( tabName )
|
||||
tabHandler(tabName == StaticTabName)
|
||||
end)
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
%15%
|
||||
-- A couple of necessary functions
|
||||
print("BackpackWardrobe.lua loaded - edit 14")
|
||||
|
||||
local function waitForChild(instance, name)
|
||||
assert(instance)
|
||||
assert(name)
|
||||
while not instance:FindFirstChild(name) do
|
||||
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
|
||||
|
||||
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 = "wardrobe"
|
||||
|
||||
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 Camera = game.Workspace.CurrentCamera
|
||||
|
||||
local playerBackpack = waitForChild(player,"Backpack")
|
||||
|
||||
waitForChild(backpack,"Tabs")
|
||||
|
||||
waitForChild(backpack,"Wardrobe")
|
||||
|
||||
local currentLoadout = waitForChild(backpack.Parent,"CurrentLoadout")
|
||||
|
||||
local walkSpeed = 16
|
||||
local screenSize = game:GetService("CoreGui"):FindFirstChild("RobloxGui").AbsoluteSize
|
||||
local rotateCharacter = false
|
||||
local rotateCharacterButton = waitForChild(backpack.Wardrobe,"PreviewButton")
|
||||
|
||||
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
|
||||
|
||||
|
||||
-- Begin Functions
|
||||
function lerpTest(from, to)
|
||||
local ax, ay, az, a11, a12, a13, a21, a22, a23, a31, a32, a33 = from:components()
|
||||
local bx, by, bz, b11, b12, b13, b21, b22, b23, b31, b32, b33 = to:components()
|
||||
|
||||
local diffx = bx - ax;
|
||||
local diffy = by - ay;
|
||||
local diffz = bz - az;
|
||||
|
||||
local diff11 = b11 - a11;
|
||||
local diff12 = b12 - a12;
|
||||
local diff13 = b13 - a13;
|
||||
|
||||
local diff21 = b21 - a21;
|
||||
local diff22 = b22 - a22;
|
||||
local diff23 = b23 - a23;
|
||||
|
||||
local diff31 = b31 - a31;
|
||||
local diff32 = b32 - a32;
|
||||
local diff33 = b33 - a33;
|
||||
|
||||
while wait(0.1) do
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
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 buttonClick(button)
|
||||
if button:FindFirstChild("UnequipContextMenu") and not button.Active then
|
||||
button.UnequipContextMenu.Visible = true
|
||||
browsingMenu = 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.Wardrobe.Visible = false
|
||||
return
|
||||
end
|
||||
|
||||
backpack.Wardrobe.Visible = true
|
||||
createView()
|
||||
tellBackpackReadyFunc:Invoke()
|
||||
end
|
||||
|
||||
function backpackCloseHandler(currentTab)
|
||||
if currentTab and currentTab ~= StaticTabName then
|
||||
backpack.Wardrobe.Visible = false
|
||||
revertView()
|
||||
return
|
||||
end
|
||||
|
||||
backpack.Wardrobe.Visible = false
|
||||
revertView()
|
||||
tellBackpackReadyFunc:Invoke()
|
||||
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 trim(s)
|
||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||
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 createView()
|
||||
-- stop player from moving and store initial speed (they can still jump though)
|
||||
if player.Character.Humanoid.WalkSpeed ~= 0 then walkSpeed = player.Character.Humanoid.WalkSpeed end
|
||||
player.Character.Humanoid.WalkSpeed = 0
|
||||
|
||||
-- initialize camera
|
||||
Camera.CameraType = Enum.CameraType.Scriptable
|
||||
focusCamera()
|
||||
end
|
||||
|
||||
function revertView()
|
||||
-- restore initial walk speed
|
||||
player.Character.Humanoid.WalkSpeed = walkSpeed
|
||||
|
||||
-- restore player camera
|
||||
Camera.CameraType = Enum.CameraType.Custom
|
||||
|
||||
-- if character spin is enabled then disable it
|
||||
if rotateCharacter then toggleCharacterSpin() end
|
||||
end
|
||||
|
||||
function focusCamera()
|
||||
if not backpack.Wardrobe.Visible then return end
|
||||
|
||||
local cameraAngle = CFrame.fromEulerAnglesXYZ(0, math.pi, 0) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0)
|
||||
local cameraPosition = CFrame.new(screenSize.X*0.00983455882, 0, screenSize.Y*-0.01527777777)
|
||||
|
||||
Camera.CoordinateFrame = game.Players.LocalPlayer.Character.Torso.CFrame * cameraPosition * cameraAngle
|
||||
end
|
||||
|
||||
function toggleCharacterSpin()
|
||||
rotateCharacter = not rotateCharacter
|
||||
|
||||
if rotateCharacter then
|
||||
rotateCharacterButton.Text = "Pause"
|
||||
else
|
||||
rotateCharacterButton.Text = "Rotate"
|
||||
end
|
||||
|
||||
while rotateCharacter do
|
||||
wait(0.05)
|
||||
player.Character.Torso.CFrame = player.Character.Torso.CFrame * CFrame.Angles(0,0.035,0)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------- Start Lifelong Connections -----------------------
|
||||
|
||||
|
||||
resizeEvent.Event:connect(function(absSize)
|
||||
if debounce then return end
|
||||
|
||||
debounce = true
|
||||
wait()
|
||||
screenSize = absSize
|
||||
focusCamera()
|
||||
debounce = false
|
||||
end)
|
||||
|
||||
|
||||
------------------------- End Lifelong Connections -----------------------
|
||||
|
||||
backpackOpenEvent.Event:connect(backpackOpenHandler)
|
||||
backpackCloseEvent.Event:connect(backpackCloseHandler)
|
||||
tabClickedEvent.Event:connect(tabClickHandler)
|
||||
rotateCharacterButton.MouseButton1Click:connect(toggleCharacterSpin)
|
||||
142
public/asset/2
142
public/asset/2
|
|
@ -1,71 +1,71 @@
|
|||
%2%
|
||||
-- this script is responsible for keeping the gui proportions under control
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
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()
|
||||
|
||||
%2%
|
||||
-- this script is responsible for keeping the gui proportions under control
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
||||
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()
|
||||
|
||||
|
|
|
|||
582
public/asset/3
582
public/asset/3
|
|
@ -1,291 +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
|
||||
%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
|
||||
|
|
|
|||
368
public/asset/4
368
public/asset/4
|
|
@ -1,184 +1,184 @@
|
|||
%4%
|
||||
-- Creates the tool tips for the new gui!
|
||||
|
||||
local controlFrame = script.Parent:FindFirstChild("ControlFrame")
|
||||
|
||||
local topLeftControl
|
||||
local bottomLeftControl
|
||||
local 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 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 = frame
|
||||
|
||||
function setUpListeners(frame)
|
||||
local fadeSpeed = 0.1
|
||||
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)
|
||||
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
|
||||
|
||||
----------------- set up Top Left Tool Tips --------------------------
|
||||
|
||||
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()
|
||||
|
||||
for i = 1, #bottomLeftChildren do
|
||||
|
||||
if bottomLeftChildren[i].Name == "Exit" then
|
||||
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
|
||||
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
|
||||
|
||||
---------------- set up Bottom Right Tool Tips -------------------------
|
||||
|
||||
local bottomRightChildren = bottomRightControl:GetChildren()
|
||||
|
||||
for i = 1, #bottomRightChildren do
|
||||
|
||||
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
|
||||
cameraTip.Position = UDim2.new(-1,0,-1.5)
|
||||
else
|
||||
cameraTip.Position = UDim2.new(0,0,-1.5,0)
|
||||
end
|
||||
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
|
||||
|
||||
|
||||
%4%
|
||||
-- Creates the tool tips for the new gui!
|
||||
|
||||
local controlFrame = script.Parent:FindFirstChild("ControlFrame")
|
||||
|
||||
local topLeftControl
|
||||
local bottomLeftControl
|
||||
local 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 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 = frame
|
||||
|
||||
function setUpListeners(frame)
|
||||
local fadeSpeed = 0.1
|
||||
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)
|
||||
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
|
||||
|
||||
----------------- set up Top Left Tool Tips --------------------------
|
||||
|
||||
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()
|
||||
|
||||
for i = 1, #bottomLeftChildren do
|
||||
|
||||
if bottomLeftChildren[i].Name == "Exit" then
|
||||
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
|
||||
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
|
||||
|
||||
---------------- set up Bottom Right Tool Tips -------------------------
|
||||
|
||||
local bottomRightChildren = bottomRightControl:GetChildren()
|
||||
|
||||
for i = 1, #bottomRightChildren do
|
||||
|
||||
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
|
||||
cameraTip.Position = UDim2.new(-1,0,-1.5)
|
||||
else
|
||||
cameraTip.Position = UDim2.new(0,0,-1.5,0)
|
||||
end
|
||||
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
|
||||
|
||||
|
||||
|
|
|
|||
3924
public/asset/5
3924
public/asset/5
File diff suppressed because it is too large
Load Diff
1096
public/asset/6
1096
public/asset/6
File diff suppressed because it is too large
Load Diff
3836
public/asset/7
3836
public/asset/7
File diff suppressed because it is too large
Load Diff
130
public/asset/8
130
public/asset/8
|
|
@ -1,66 +1,66 @@
|
|||
%8%
|
||||
--build our gui
|
||||
|
||||
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 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 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 declineButton = acceptButton:clone()
|
||||
declineButton.Position = UDim2.new(1,-120,0,270)
|
||||
declineButton.Text = "No"
|
||||
declineButton.Name = "DeclineButton"
|
||||
declineButton.Parent = popupFrame
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
%8%
|
||||
--build our gui
|
||||
|
||||
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 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 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 declineButton = acceptButton:clone()
|
||||
declineButton.Position = UDim2.new(1,-120,0,270)
|
||||
declineButton.Text = "No"
|
||||
declineButton.Name = "DeclineButton"
|
||||
declineButton.Parent = popupFrame
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
script:remove()
|
||||
162
public/asset/9
162
public/asset/9
|
|
@ -1,82 +1,82 @@
|
|||
%9%
|
||||
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
|
||||
|
||||
waitForProperty(game.Players,"LocalPlayer")
|
||||
waitForChild(script.Parent,"Popup")
|
||||
|
||||
local localPlayer = game.Players.LocalPlayer
|
||||
|
||||
local makePopupInvisible = function()
|
||||
if script.Parent.Popup then script.Parent.Popup.Visible = false end
|
||||
end
|
||||
|
||||
function makeFriend(fromPlayer,toPlayer)
|
||||
|
||||
local popup = script.Parent.Popup
|
||||
if popup == nil then return end -- there is no popup!
|
||||
if popup.Visible then return end -- currently popping something, abort!
|
||||
|
||||
popup.PopupText.Text = "Accept Friend Request from " .. tostring(fromPlayer.Name) .. "?"
|
||||
popup.PopupImage.Image = "http://www.youtube.pengin.xyz/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=352&y=352"
|
||||
|
||||
popup.Visible = true
|
||||
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
|
||||
|
||||
local yesCon, noCon
|
||||
|
||||
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)
|
||||
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.youtube.pengin.xyz/thumbs/avatar.ashx?userId="..tostring(toPlayer.userId).."&x=48&y=48",
|
||||
5)
|
||||
end
|
||||
elseif toPlayer == localPlayer then
|
||||
if event == Enum.FriendRequestEvent.Issue then
|
||||
game:GetService("GuiService"):SendNotification("Friend Request",
|
||||
"From " .. fromPlayer.Name,
|
||||
"http://www.youtube.pengin.xyz/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.youtube.pengin.xyz/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48",
|
||||
5)
|
||||
end
|
||||
end
|
||||
%9%
|
||||
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
|
||||
|
||||
waitForProperty(game.Players,"LocalPlayer")
|
||||
waitForChild(script.Parent,"Popup")
|
||||
|
||||
local localPlayer = game.Players.LocalPlayer
|
||||
|
||||
local makePopupInvisible = function()
|
||||
if script.Parent.Popup then script.Parent.Popup.Visible = false end
|
||||
end
|
||||
|
||||
function makeFriend(fromPlayer,toPlayer)
|
||||
|
||||
local popup = script.Parent.Popup
|
||||
if popup == nil then return end -- there is no popup!
|
||||
if popup.Visible then return end -- currently popping something, abort!
|
||||
|
||||
popup.PopupText.Text = "Accept Friend Request from " .. tostring(fromPlayer.Name) .. "?"
|
||||
popup.PopupImage.Image = "http://www.youtube.pengin.xyz/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=352&y=352"
|
||||
|
||||
popup.Visible = true
|
||||
popup:TweenSize(UDim2.new(0,330,0,350),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,1,true)
|
||||
|
||||
local yesCon, noCon
|
||||
|
||||
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)
|
||||
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.youtube.pengin.xyz/thumbs/avatar.ashx?userId="..tostring(toPlayer.userId).."&x=48&y=48",
|
||||
5)
|
||||
end
|
||||
elseif toPlayer == localPlayer then
|
||||
if event == Enum.FriendRequestEvent.Issue then
|
||||
game:GetService("GuiService"):SendNotification("Friend Request",
|
||||
"From " .. fromPlayer.Name,
|
||||
"http://www.youtube.pengin.xyz/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.youtube.pengin.xyz/thumbs/avatar.ashx?userId="..tostring(fromPlayer.userId).."&x=48&y=48",
|
||||
5)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
@ -1,57 +1,55 @@
|
|||
<?php
|
||||
ob_start();
|
||||
|
||||
function sign($data) {
|
||||
$PrivKey = file_get_contents("./PrivKey.pem");
|
||||
openssl_sign($data, $signature, $PrivKey, OPENSSL_ALGO_SHA1);
|
||||
echo sprintf("%%%s%%%s", base64_encode($signature), $data);
|
||||
}
|
||||
|
||||
$id = (int)($_GET["id"] ?? die(json_encode(["message" => "Error handling your request."])));
|
||||
$version = isset($_GET["version"]) ? filter_var($_GET["version"], FILTER_SANITIZE_NUMBER_INT, FILTER_NULL_ON_FAILURE) : -1;
|
||||
|
||||
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/asset/" . $id)){
|
||||
$file = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/asset/" . $id);
|
||||
if (isset($_GET["sign"]) == true){
|
||||
sign($file);
|
||||
}else if($id == 1){
|
||||
sign($file);
|
||||
}else if($id == 2){
|
||||
sign($file);
|
||||
}else if($id == 3){
|
||||
sign($file);
|
||||
}else if($id == 4){
|
||||
sign($file);
|
||||
}else if($id == 5){
|
||||
sign($file);
|
||||
}else if($id == 7){
|
||||
sign($file);
|
||||
}else if($id == 6){
|
||||
sign($file);
|
||||
}else if($id == 8){
|
||||
sign($file);
|
||||
}else if($id == 9){
|
||||
sign($file);
|
||||
}else if($id == 10){
|
||||
sign($file);
|
||||
}else if($id == 11){
|
||||
sign($file);
|
||||
}else if($id == 12){
|
||||
sign($file);
|
||||
}else if($id == 13){
|
||||
sign($file);
|
||||
}else if($id == 14){
|
||||
sign($file);
|
||||
}else if($id == 1000){
|
||||
sign($file);
|
||||
}else if($id == 38037265){
|
||||
sign($file);
|
||||
}else{
|
||||
echo $file;
|
||||
}
|
||||
}else{
|
||||
header("Location: https://assetdelivery.roblox.com/v1/asset/?id=$id&version=$version");
|
||||
die();
|
||||
}
|
||||
<?php
|
||||
ob_start();
|
||||
|
||||
function sign($data) {
|
||||
$PrivKey = file_get_contents("./PrivKey.pem");
|
||||
openssl_sign($data, $signature, $PrivKey, OPENSSL_ALGO_SHA1);
|
||||
echo sprintf("%%%s%%%s", base64_encode($signature), $data);
|
||||
}
|
||||
|
||||
$id = (int)($_GET["id"] ?? die(json_encode(["message" => "Error handling your request."])));
|
||||
$version = isset($_GET["version"]) ? filter_var($_GET["version"], FILTER_SANITIZE_NUMBER_INT, FILTER_NULL_ON_FAILURE) : -1;
|
||||
|
||||
|
||||
if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/asset/" . $id)){
|
||||
$file = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/asset/" . $id);
|
||||
if (isset($_GET["sign"]) == true){
|
||||
sign($file);
|
||||
}else if($id == 1){
|
||||
sign($file);
|
||||
}else if($id == 2){
|
||||
sign($file);
|
||||
}else if($id == 3){
|
||||
sign($file);
|
||||
}else if($id == 4){
|
||||
sign($file);
|
||||
}else if($id == 5){
|
||||
sign($file);
|
||||
}else if($id == 7){
|
||||
sign($file);
|
||||
}else if($id == 6){
|
||||
sign($file);
|
||||
}else if($id == 8){
|
||||
sign($file);
|
||||
}else if($id == 9){
|
||||
sign($file);
|
||||
}else if($id == 10){
|
||||
sign($file);
|
||||
}else if($id == 11){
|
||||
sign($file);
|
||||
}else if($id == 12){
|
||||
sign($file);
|
||||
}else if($id == 13){
|
||||
sign($file);
|
||||
}else if($id == 14){
|
||||
sign($file);
|
||||
}else if($id == 15){
|
||||
sign($file);
|
||||
}else{
|
||||
echo $file;
|
||||
}
|
||||
}else{
|
||||
header("Location: https://assetdelivery.roblox.com/v1/asset/?id=$id&version=$version");
|
||||
die();
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue