asset update
This commit is contained in:
parent
8d032fdc59
commit
9df49c7532
220
public/asset/12
220
public/asset/12
|
|
@ -1,4 +1,4 @@
|
||||||
%12%
|
%12%
|
||||||
-- This script creates almost all gui elements found in the backpack (warning: there are a lot!)
|
-- This script creates almost all gui elements found in the backpack (warning: there are a lot!)
|
||||||
-- TODO: automate this process
|
-- TODO: automate this process
|
||||||
|
|
||||||
|
|
@ -18,6 +18,12 @@ local function waitForProperty(instance, property)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function IsTouchDevice()
|
||||||
|
local touchEnabled = false
|
||||||
|
pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end)
|
||||||
|
return touchEnabled
|
||||||
|
end
|
||||||
|
|
||||||
waitForChild(game,"Players")
|
waitForChild(game,"Players")
|
||||||
waitForProperty(game.Players,"LocalPlayer")
|
waitForProperty(game.Players,"LocalPlayer")
|
||||||
local player = game.Players.LocalPlayer
|
local player = game.Players.LocalPlayer
|
||||||
|
|
@ -25,12 +31,29 @@ local player = game.Players.LocalPlayer
|
||||||
-- First up is the current loadout
|
-- First up is the current loadout
|
||||||
local CurrentLoadout = Instance.new("Frame")
|
local CurrentLoadout = Instance.new("Frame")
|
||||||
CurrentLoadout.Name = "CurrentLoadout"
|
CurrentLoadout.Name = "CurrentLoadout"
|
||||||
CurrentLoadout.Position = UDim2.new(0.5, -240, 1, -85)
|
CurrentLoadout.Position = UDim2.new(0.5, -300, 1, -85)
|
||||||
CurrentLoadout.Size = UDim2.new(0, 480, 0, 48)
|
CurrentLoadout.Size = UDim2.new(0, 600, 0, 54)
|
||||||
CurrentLoadout.BackgroundTransparency = 1
|
CurrentLoadout.BackgroundTransparency = 1
|
||||||
CurrentLoadout.RobloxLocked = true
|
CurrentLoadout.RobloxLocked = true
|
||||||
CurrentLoadout.Parent = gui
|
CurrentLoadout.Parent = gui
|
||||||
|
|
||||||
|
local CLBackground = Instance.new('ImageLabel')
|
||||||
|
CLBackground.Name = 'Background';
|
||||||
|
CLBackground.Size = UDim2.new(1.2, 0, 1.2, 0);
|
||||||
|
CLBackground.Image = "http://www.morblox.us/asset/?id=96536002"
|
||||||
|
CLBackground.BackgroundTransparency = 1.0;
|
||||||
|
CLBackground.Position = UDim2.new(-0.1, 0, -0.1, 0);
|
||||||
|
CLBackground.ZIndex = 0.0;
|
||||||
|
CLBackground.Parent = CurrentLoadout
|
||||||
|
CLBackground.Visible = false
|
||||||
|
|
||||||
|
local BackgroundUp = Instance.new('ImageLabel')
|
||||||
|
BackgroundUp.Size = UDim2.new(1, 0, 0.025, 1)
|
||||||
|
BackgroundUp.Position = UDim2.new(0, 0, 0, 0)
|
||||||
|
BackgroundUp.Image = 'http://www.morblox.us/asset/?id=97662207'
|
||||||
|
BackgroundUp.BackgroundTransparency = 1.0
|
||||||
|
BackgroundUp.Parent = CLBackground
|
||||||
|
|
||||||
local Debounce = Instance.new("BoolValue")
|
local Debounce = Instance.new("BoolValue")
|
||||||
Debounce.Name = "Debounce"
|
Debounce.Name = "Debounce"
|
||||||
Debounce.RobloxLocked = true
|
Debounce.RobloxLocked = true
|
||||||
|
|
@ -41,36 +64,73 @@ BackpackButton.RobloxLocked = true
|
||||||
BackpackButton.Visible = false
|
BackpackButton.Visible = false
|
||||||
BackpackButton.Name = "BackpackButton"
|
BackpackButton.Name = "BackpackButton"
|
||||||
BackpackButton.BackgroundTransparency = 1
|
BackpackButton.BackgroundTransparency = 1
|
||||||
BackpackButton.Image = "rbxasset://textures/ui/backpackButton.png"
|
BackpackButton.Image = "http://www.morblox.us/asset/?id=97617958"
|
||||||
BackpackButton.Position = UDim2.new(0.5, -195, 1, -30)
|
BackpackButton.Position = UDim2.new(0.5, -60, 1, -108)
|
||||||
BackpackButton.Size = UDim2.new(0,107,0,26)
|
BackpackButton.Size = UDim2.new(0, 120, 0, 18)
|
||||||
waitForChild(gui,"ControlFrame")
|
waitForChild(gui,"ControlFrame")
|
||||||
BackpackButton.Parent = gui.ControlFrame
|
BackpackButton.Parent = gui.ControlFrame
|
||||||
|
|
||||||
for i = 0, 9 do
|
local NumSlots = 9
|
||||||
|
|
||||||
|
if gui.AbsoluteSize.Y <= 320 then
|
||||||
|
NumSlots = 3
|
||||||
|
CurrentLoadout.Size = UDim2.new(0, 180, 0, 54)
|
||||||
|
CurrentLoadout.Position = UDim2.new(0.5, -90, 1, -85)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
for i = 0, NumSlots do
|
||||||
local slotFrame = Instance.new("Frame")
|
local slotFrame = Instance.new("Frame")
|
||||||
slotFrame.RobloxLocked = true
|
slotFrame.RobloxLocked = true
|
||||||
slotFrame.BackgroundColor3 = Color3.new(0,0,0)
|
slotFrame.BackgroundColor3 = Color3.new(0,0,0)
|
||||||
slotFrame.BackgroundTransparency = 1
|
slotFrame.BackgroundTransparency = 1
|
||||||
slotFrame.BorderColor3 = Color3.new(1,1,1)
|
slotFrame.BorderColor3 = Color3.new(1, 1, 1)
|
||||||
slotFrame.Name = "Slot" .. tostring(i)
|
slotFrame.Name = "Slot" .. tostring(i)
|
||||||
|
slotFrame.ZIndex = 4.0
|
||||||
if i == 0 then
|
if i == 0 then
|
||||||
slotFrame.Position = UDim2.new(0.9,0,0,0)
|
slotFrame.Position = UDim2.new(0.9, 0, 0, 0)
|
||||||
else
|
else
|
||||||
slotFrame.Position = UDim2.new((i - 1) * 0.1,0,0,0)
|
slotFrame.Position = UDim2.new((i - 1) * 0.1, (i-1)* 6,0,0)
|
||||||
end
|
end
|
||||||
slotFrame.Size = UDim2.new(0.1,0,1,0)
|
|
||||||
slotFrame.Parent = CurrentLoadout
|
|
||||||
|
slotFrame.Size = UDim2.new(0, 54, 1, 0)
|
||||||
|
slotFrame.Parent = CurrentLoadout
|
||||||
|
|
||||||
|
if gui.AbsoluteSize.Y <= 320 then
|
||||||
|
slotFrame.Position = UDim2.new(0, (i-1)* 60, 0, -50)
|
||||||
|
print('Well got here', slotFrame, slotFrame.Position.X.Scale, slotFrame.Position.X.Offset)
|
||||||
|
end
|
||||||
|
if gui.AbsoluteSize.Y <= 320 and i == 0 then
|
||||||
|
slotFrame:Destroy()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local TempSlot = Instance.new("ImageButton")
|
local TempSlot = Instance.new("ImageButton")
|
||||||
TempSlot.Name = "TempSlot"
|
TempSlot.Name = "TempSlot"
|
||||||
TempSlot.Active = true
|
TempSlot.Active = true
|
||||||
TempSlot.Size = UDim2.new(1,0,1,0)
|
TempSlot.Size = UDim2.new(1,0,1,0)
|
||||||
TempSlot.Style = Enum.ButtonStyle.RobloxButton
|
TempSlot.BackgroundTransparency = 1.0
|
||||||
|
TempSlot.Style = 'Custom'
|
||||||
TempSlot.Visible = false
|
TempSlot.Visible = false
|
||||||
TempSlot.RobloxLocked = true
|
TempSlot.RobloxLocked = true
|
||||||
TempSlot.Parent = CurrentLoadout
|
TempSlot.Parent = CurrentLoadout
|
||||||
|
TempSlot.ZIndex = 3.0
|
||||||
|
|
||||||
|
local slotBackground = Instance.new('ImageLabel')
|
||||||
|
slotBackground.Name = 'Background'
|
||||||
|
slotBackground.BackgroundTransparency = 1.0
|
||||||
|
slotBackground.Image = 'http://www.morblox.us/asset/?id=97613075'
|
||||||
|
slotBackground.Size = UDim2.new(1, 0, 1, 0)
|
||||||
|
slotBackground.Parent = TempSlot
|
||||||
|
|
||||||
|
local HighLight = Instance.new('ImageLabel')
|
||||||
|
HighLight.Name = 'Highlight'
|
||||||
|
HighLight.BackgroundTransparency = 1.0
|
||||||
|
HighLight.Image = 'http://www.morblox.us/asset/?id=97643886'
|
||||||
|
HighLight.Size = UDim2.new(1, 0, 1, 0)
|
||||||
|
--HighLight.Parent = TempSlot
|
||||||
|
HighLight.Visible = false
|
||||||
|
|
||||||
-- TempSlot Children
|
-- TempSlot Children
|
||||||
local GearReference = Instance.new("ObjectValue")
|
local GearReference = Instance.new("ObjectValue")
|
||||||
|
|
@ -78,6 +138,7 @@ TempSlot.Parent = CurrentLoadout
|
||||||
GearReference.RobloxLocked = true
|
GearReference.RobloxLocked = true
|
||||||
GearReference.Parent = TempSlot
|
GearReference.Parent = TempSlot
|
||||||
|
|
||||||
|
|
||||||
local ToolTipLabel = Instance.new("TextLabel")
|
local ToolTipLabel = Instance.new("TextLabel")
|
||||||
ToolTipLabel.Name = "ToolTipLabel"
|
ToolTipLabel.Name = "ToolTipLabel"
|
||||||
ToolTipLabel.RobloxLocked = true
|
ToolTipLabel.RobloxLocked = true
|
||||||
|
|
@ -94,6 +155,7 @@ TempSlot.Parent = CurrentLoadout
|
||||||
ToolTipLabel.Size = UDim2.new(1,60,0,20)
|
ToolTipLabel.Size = UDim2.new(1,60,0,20)
|
||||||
ToolTipLabel.Position = UDim2.new(0,-30,0,-30)
|
ToolTipLabel.Position = UDim2.new(0,-30,0,-30)
|
||||||
ToolTipLabel.Parent = TempSlot
|
ToolTipLabel.Parent = TempSlot
|
||||||
|
|
||||||
|
|
||||||
local Kill = Instance.new("BoolValue")
|
local Kill = Instance.new("BoolValue")
|
||||||
Kill.Name = "Kill"
|
Kill.Name = "Kill"
|
||||||
|
|
@ -103,9 +165,9 @@ TempSlot.Parent = CurrentLoadout
|
||||||
local GearImage = Instance.new("ImageLabel")
|
local GearImage = Instance.new("ImageLabel")
|
||||||
GearImage.Name = "GearImage"
|
GearImage.Name = "GearImage"
|
||||||
GearImage.BackgroundTransparency = 1
|
GearImage.BackgroundTransparency = 1
|
||||||
GearImage.Position = UDim2.new(0,-7,0,-7)
|
GearImage.Position = UDim2.new(0, 0, 0, 0)
|
||||||
GearImage.Size = UDim2.new(1,14,1,14)
|
GearImage.Size = UDim2.new(1, 0, 1, 0)
|
||||||
GearImage.ZIndex = 2
|
GearImage.ZIndex = 5.0
|
||||||
GearImage.RobloxLocked = true
|
GearImage.RobloxLocked = true
|
||||||
GearImage.Parent = TempSlot
|
GearImage.Parent = TempSlot
|
||||||
|
|
||||||
|
|
@ -115,26 +177,30 @@ TempSlot.Parent = CurrentLoadout
|
||||||
SlotNumber.BorderSizePixel = 0
|
SlotNumber.BorderSizePixel = 0
|
||||||
SlotNumber.Font = Enum.Font.ArialBold
|
SlotNumber.Font = Enum.Font.ArialBold
|
||||||
SlotNumber.FontSize = Enum.FontSize.Size18
|
SlotNumber.FontSize = Enum.FontSize.Size18
|
||||||
SlotNumber.Position = UDim2.new(0,-7,0,-7)
|
SlotNumber.Position = UDim2.new(0, 0, 0, 0)
|
||||||
SlotNumber.Size = UDim2.new(0,10,0,15)
|
SlotNumber.Size = UDim2.new(0,10,0,15)
|
||||||
SlotNumber.TextColor3 = Color3.new(1,1,1)
|
SlotNumber.TextColor3 = Color3.new(1,1,1)
|
||||||
SlotNumber.TextTransparency = 0
|
SlotNumber.TextTransparency = 0
|
||||||
SlotNumber.TextXAlignment = Enum.TextXAlignment.Left
|
SlotNumber.TextXAlignment = Enum.TextXAlignment.Left
|
||||||
SlotNumber.TextYAlignment = Enum.TextYAlignment.Bottom
|
SlotNumber.TextYAlignment = Enum.TextYAlignment.Bottom
|
||||||
SlotNumber.ZIndex = 4
|
|
||||||
SlotNumber.RobloxLocked = true
|
SlotNumber.RobloxLocked = true
|
||||||
SlotNumber.Parent = TempSlot
|
SlotNumber.Parent = TempSlot
|
||||||
|
SlotNumber.ZIndex = 5
|
||||||
|
|
||||||
|
if IsTouchDevice() then
|
||||||
|
SlotNumber.Visible = false
|
||||||
|
end
|
||||||
|
|
||||||
local SlotNumberDownShadow = SlotNumber:clone()
|
local SlotNumberDownShadow = SlotNumber:Clone()
|
||||||
SlotNumberDownShadow.Name = "SlotNumberDownShadow"
|
SlotNumberDownShadow.Name = "SlotNumberDownShadow"
|
||||||
SlotNumberDownShadow.TextColor3 = Color3.new(0,0,0)
|
SlotNumberDownShadow.TextColor3 = Color3.new(0,0,0)
|
||||||
SlotNumberDownShadow.ZIndex = 3
|
SlotNumberDownShadow.Position = UDim2.new(0, 1, 0, -1)
|
||||||
SlotNumberDownShadow.Position = UDim2.new(0,-6,0,-6)
|
|
||||||
SlotNumberDownShadow.Parent = TempSlot
|
SlotNumberDownShadow.Parent = TempSlot
|
||||||
|
SlotNumberDownShadow.ZIndex = 2
|
||||||
|
|
||||||
local SlotNumberUpShadow = SlotNumberDownShadow:clone()
|
local SlotNumberUpShadow = SlotNumberDownShadow:Clone()
|
||||||
SlotNumberUpShadow.Name = "SlotNumberUpShadow"
|
SlotNumberUpShadow.Name = "SlotNumberUpShadow"
|
||||||
SlotNumberUpShadow.Position = UDim2.new(0,-8,0,-8)
|
SlotNumberUpShadow.Position = UDim2.new(0, -1, 0, -1)
|
||||||
SlotNumberUpShadow.Parent = TempSlot
|
SlotNumberUpShadow.Parent = TempSlot
|
||||||
|
|
||||||
local GearText = Instance.new("TextLabel")
|
local GearText = Instance.new("TextLabel")
|
||||||
|
|
@ -143,8 +209,7 @@ TempSlot.Parent = CurrentLoadout
|
||||||
GearText.BackgroundTransparency = 1
|
GearText.BackgroundTransparency = 1
|
||||||
GearText.Font = Enum.Font.Arial
|
GearText.Font = Enum.Font.Arial
|
||||||
GearText.FontSize = Enum.FontSize.Size14
|
GearText.FontSize = Enum.FontSize.Size14
|
||||||
GearText.Position = UDim2.new(0,-8,0,-8)
|
GearText.Position = UDim2.new(0,-8,0,-8)
|
||||||
GearText.ZIndex = 2
|
|
||||||
GearText.Size = UDim2.new(1,16,1,16)
|
GearText.Size = UDim2.new(1,16,1,16)
|
||||||
GearText.Text = ""
|
GearText.Text = ""
|
||||||
GearText.TextColor3 = Color3.new(1,1,1)
|
GearText.TextColor3 = Color3.new(1,1,1)
|
||||||
|
|
@ -157,9 +222,9 @@ local Backpack = Instance.new("Frame")
|
||||||
Backpack.RobloxLocked = true
|
Backpack.RobloxLocked = true
|
||||||
Backpack.Visible = false
|
Backpack.Visible = false
|
||||||
Backpack.Name = "Backpack"
|
Backpack.Name = "Backpack"
|
||||||
Backpack.Position = UDim2.new(0.5,0,0.5,0)
|
Backpack.Position = UDim2.new(0.5, 0, 0.5, 0)
|
||||||
Backpack.BackgroundColor3 = Color3.new(0,0,0)
|
Backpack.BackgroundColor3 = Color3.new(32/255, 32/255, 32/255)
|
||||||
Backpack.BackgroundTransparency = 0.08
|
Backpack.BackgroundTransparency = 0.0
|
||||||
Backpack.BorderSizePixel = 0
|
Backpack.BorderSizePixel = 0
|
||||||
Backpack.Parent = gui
|
Backpack.Parent = gui
|
||||||
Backpack.Active = true
|
Backpack.Active = true
|
||||||
|
|
@ -183,7 +248,8 @@ Backpack.Active = true
|
||||||
|
|
||||||
local Tabs = Instance.new("Frame")
|
local Tabs = Instance.new("Frame")
|
||||||
Tabs.Name = "Tabs"
|
Tabs.Name = "Tabs"
|
||||||
Tabs.Visible = true
|
Tabs.Visible = false
|
||||||
|
Tabs.Active = false
|
||||||
Tabs.RobloxLocked = true
|
Tabs.RobloxLocked = true
|
||||||
Tabs.BackgroundColor3 = Color3.new(0,0,0)
|
Tabs.BackgroundColor3 = Color3.new(0,0,0)
|
||||||
Tabs.BackgroundTransparency = 0.08
|
Tabs.BackgroundTransparency = 0.08
|
||||||
|
|
@ -221,21 +287,23 @@ Backpack.Active = true
|
||||||
InventoryButton.ZIndex = 3
|
InventoryButton.ZIndex = 3
|
||||||
InventoryButton.Parent = Tabs
|
InventoryButton.Parent = Tabs
|
||||||
|
|
||||||
local WardrobeButton = Instance.new("TextButton")
|
if game.CoreGui.Version >= 8 then
|
||||||
WardrobeButton.RobloxLocked = true
|
local WardrobeButton = Instance.new("TextButton")
|
||||||
WardrobeButton.Name = "WardrobeButton"
|
WardrobeButton.RobloxLocked = true
|
||||||
WardrobeButton.Size = UDim2.new(0,90,0,30)
|
WardrobeButton.Name = "WardrobeButton"
|
||||||
WardrobeButton.Position = UDim2.new(0,77,1,-31)
|
WardrobeButton.Size = UDim2.new(0,90,0,30)
|
||||||
WardrobeButton.BackgroundColor3 = Color3.new(0,0,0)
|
WardrobeButton.Position = UDim2.new(0,77,1,-31)
|
||||||
WardrobeButton.BorderColor3 = Color3.new(1,1,1)
|
WardrobeButton.BackgroundColor3 = Color3.new(0,0,0)
|
||||||
WardrobeButton.Font = Enum.Font.ArialBold
|
WardrobeButton.BorderColor3 = Color3.new(1,1,1)
|
||||||
WardrobeButton.FontSize = Enum.FontSize.Size18
|
WardrobeButton.Font = Enum.Font.ArialBold
|
||||||
WardrobeButton.Text = "Wardrobe"
|
WardrobeButton.FontSize = Enum.FontSize.Size18
|
||||||
WardrobeButton.AutoButtonColor = false
|
WardrobeButton.Text = "Wardrobe"
|
||||||
WardrobeButton.TextColor3 = Color3.new(1,1,1)
|
WardrobeButton.AutoButtonColor = false
|
||||||
WardrobeButton.Selected = false
|
WardrobeButton.TextColor3 = Color3.new(1,1,1)
|
||||||
WardrobeButton.Active = true
|
WardrobeButton.Selected = false
|
||||||
WardrobeButton.Parent = Tabs
|
WardrobeButton.Active = true
|
||||||
|
WardrobeButton.Parent = Tabs
|
||||||
|
end
|
||||||
|
|
||||||
local closeButton = Instance.new("TextButton")
|
local closeButton = Instance.new("TextButton")
|
||||||
closeButton.RobloxLocked = true
|
closeButton.RobloxLocked = true
|
||||||
|
|
@ -254,8 +322,8 @@ Backpack.Active = true
|
||||||
local XImage = Instance.new("ImageLabel")
|
local XImage = Instance.new("ImageLabel")
|
||||||
XImage.RobloxLocked = true
|
XImage.RobloxLocked = true
|
||||||
XImage.Name = "XImage"
|
XImage.Name = "XImage"
|
||||||
game:GetService("ContentProvider"):Preload("http://morblox.us/asset/?id=75547445")
|
game:GetService("ContentProvider"):Preload("http://www.morblox.us/asset/?id=75547445")
|
||||||
XImage.Image = "http://morblox.us/asset/?id=75547445" --TODO: move to rbxasset
|
XImage.Image = "http://www.morblox.us/asset/?id=75547445" --TODO: move to rbxasset
|
||||||
XImage.BackgroundTransparency = 1
|
XImage.BackgroundTransparency = 1
|
||||||
XImage.Position = UDim2.new(-.25,-1,-.25,-1)
|
XImage.Position = UDim2.new(-.25,-1,-.25,-1)
|
||||||
XImage.Size = UDim2.new(1.5,2,1.5,2)
|
XImage.Size = UDim2.new(1.5,2,1.5,2)
|
||||||
|
|
@ -341,18 +409,27 @@ Backpack.Active = true
|
||||||
local GearGrid = Instance.new("Frame")
|
local GearGrid = Instance.new("Frame")
|
||||||
GearGrid.RobloxLocked = true
|
GearGrid.RobloxLocked = true
|
||||||
GearGrid.Name = "GearGrid"
|
GearGrid.Name = "GearGrid"
|
||||||
GearGrid.Size = UDim2.new(0.69,0,1,0)
|
GearGrid.Size = UDim2.new(0.95, 0, 1, 0)
|
||||||
GearGrid.BackgroundTransparency = 1
|
GearGrid.BackgroundTransparency = 1
|
||||||
GearGrid.Parent = Gear
|
GearGrid.Parent = Gear
|
||||||
|
|
||||||
|
|
||||||
local GearButton = Instance.new("ImageButton")
|
local GearButton = Instance.new("ImageButton")
|
||||||
GearButton.RobloxLocked = true
|
GearButton.RobloxLocked = true
|
||||||
GearButton.Visible = false
|
GearButton.Visible = false
|
||||||
GearButton.Name = "GearButton"
|
GearButton.Name = "GearButton"
|
||||||
GearButton.Size = UDim2.new(0,64,0,64)
|
GearButton.Size = UDim2.new(0, 54, 0, 54)
|
||||||
GearButton.Style = Enum.ButtonStyle.RobloxButton
|
GearButton.Style = 'Custom'
|
||||||
GearButton.Parent = GearGrid
|
GearButton.Parent = GearGrid
|
||||||
|
GearButton.BackgroundTransparency = 1.0
|
||||||
|
|
||||||
|
local slotBackground = Instance.new('ImageLabel')
|
||||||
|
slotBackground.Name = 'Background'
|
||||||
|
slotBackground.BackgroundTransparency = 1.0
|
||||||
|
slotBackground.Image = 'http://www.morblox.us/asset/?id=97613075'
|
||||||
|
slotBackground.Size = UDim2.new(1, 0, 1, 0)
|
||||||
|
slotBackground.Parent = GearButton
|
||||||
|
|
||||||
|
|
||||||
-- GearButton Children
|
-- GearButton Children
|
||||||
local GearReference = Instance.new("ObjectValue")
|
local GearReference = Instance.new("ObjectValue")
|
||||||
|
|
@ -387,8 +464,8 @@ Backpack.Active = true
|
||||||
local GearGridScrollingArea = Instance.new("Frame")
|
local GearGridScrollingArea = Instance.new("Frame")
|
||||||
GearGridScrollingArea.RobloxLocked = true
|
GearGridScrollingArea.RobloxLocked = true
|
||||||
GearGridScrollingArea.Name = "GearGridScrollingArea"
|
GearGridScrollingArea.Name = "GearGridScrollingArea"
|
||||||
GearGridScrollingArea.Position = UDim2.new(0.7,0,0,35)
|
GearGridScrollingArea.Position = UDim2.new(1, -19, 0, 35)
|
||||||
GearGridScrollingArea.Size = UDim2.new(0,17,1,-45)
|
GearGridScrollingArea.Size = UDim2.new(0, 17, 1, -45)
|
||||||
GearGridScrollingArea.BackgroundTransparency = 1
|
GearGridScrollingArea.BackgroundTransparency = 1
|
||||||
GearGridScrollingArea.Parent = Gear
|
GearGridScrollingArea.Parent = Gear
|
||||||
|
|
||||||
|
|
@ -527,6 +604,12 @@ Backpack.Active = true
|
||||||
AttributeThreeImage.Parent = GearIcons
|
AttributeThreeImage.Parent = GearIcons
|
||||||
|
|
||||||
------------------------------- WARDROBE -------------------------------------------------------
|
------------------------------- WARDROBE -------------------------------------------------------
|
||||||
|
if game.CoreGui.Version < 8 then
|
||||||
|
-- no need for this to stick around, we aren't ready for wardrobe
|
||||||
|
script:remove()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local function makeCharFrame(frameName, parent)
|
local function makeCharFrame(frameName, parent)
|
||||||
local frame = Instance.new("Frame")
|
local frame = Instance.new("Frame")
|
||||||
frame.RobloxLocked = true
|
frame.RobloxLocked = true
|
||||||
|
|
@ -676,24 +759,24 @@ Backpack.Active = true
|
||||||
|
|
||||||
--CharacterPane Children
|
--CharacterPane Children
|
||||||
local FaceFrame = makeCharFrame("FacesFrame", CharacterPane)
|
local FaceFrame = makeCharFrame("FacesFrame", CharacterPane)
|
||||||
game:GetService("ContentProvider"):Preload("http://morblox.us/asset/?id=75460621")
|
game:GetService("ContentProvider"):Preload("http://www.morblox.us/asset/?id=75460621")
|
||||||
makeZone("FaceZone","http://morblox.us/asset/?id=75460621",UDim2.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),FaceFrame)
|
makeZone("FaceZone","http://www.morblox.us/asset/?id=75460621",UDim2.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),FaceFrame)
|
||||||
makeStyledButton("Face",UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),FaceFrame)
|
makeStyledButton("Face",UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),FaceFrame)
|
||||||
|
|
||||||
local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane)
|
local HeadFrame = makeCharFrame("HeadsFrame", CharacterPane)
|
||||||
makeZone("FaceZone","http://morblox.us/asset/?id=75460621",UDim2.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),HeadFrame)
|
makeZone("FaceZone","http://www.morblox.us/asset/?id=75460621",UDim2.new(0,157,0,137),UDim2.new(0.5,-78,0.5,-68),HeadFrame)
|
||||||
makeStyledButton("Head",UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),HeadFrame)
|
makeStyledButton("Head",UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-135),HeadFrame)
|
||||||
|
|
||||||
local HatsFrame = makeCharFrame("HatsFrame", CharacterPane)
|
local HatsFrame = makeCharFrame("HatsFrame", CharacterPane)
|
||||||
game:GetService("ContentProvider"):Preload("http://morblox.us/asset/?id=75457888")
|
game:GetService("ContentProvider"):Preload("http://www.morblox.us/asset/?id=75457888")
|
||||||
local HatsZone = makeZone("HatsZone","http://morblox.us/asset/?id=75457888",UDim2.new(0,186,0,184),UDim2.new(0.5,-93,0.5,-100), HatsFrame)
|
local HatsZone = makeZone("HatsZone","http://www.morblox.us/asset/?id=75457888",UDim2.new(0,186,0,184),UDim2.new(0.5,-93,0.5,-100), HatsFrame)
|
||||||
makeStyledButton("Hat1Button",UDim2.new(0,64,0,64),UDim2.new(0,-1,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton)
|
makeStyledButton("Hat1Button",UDim2.new(0,64,0,64),UDim2.new(0,-1,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton)
|
||||||
makeStyledButton("Hat2Button",UDim2.new(0,64,0,64),UDim2.new(0,63,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton)
|
makeStyledButton("Hat2Button",UDim2.new(0,64,0,64),UDim2.new(0,63,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton)
|
||||||
makeStyledButton("Hat3Button",UDim2.new(0,64,0,64),UDim2.new(0,127,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton)
|
makeStyledButton("Hat3Button",UDim2.new(0,64,0,64),UDim2.new(0,127,0,-1),HatsZone,Enum.ButtonStyle.RobloxButton)
|
||||||
|
|
||||||
local PantsFrame = makeCharFrame("PantsFrame", CharacterPane)
|
local PantsFrame = makeCharFrame("PantsFrame", CharacterPane)
|
||||||
game:GetService("ContentProvider"):Preload("http://morblox.us/asset/?id=75457920")
|
game:GetService("ContentProvider"):Preload("http://www.morblox.us/asset/?id=75457920")
|
||||||
makeZone("PantsZone","http://morblox.us/asset/?id=75457920",UDim2.new(0,121,0,99),UDim2.new(0.5,-60,0.5,-100),PantsFrame)
|
makeZone("PantsZone","http://www.morblox.us/asset/?id=75457920",UDim2.new(0,121,0,99),UDim2.new(0.5,-60,0.5,-100),PantsFrame)
|
||||||
|
|
||||||
local pantFrame = Instance.new("Frame")
|
local pantFrame = Instance.new("Frame")
|
||||||
pantFrame.RobloxLocked = true
|
pantFrame.RobloxLocked = true
|
||||||
|
|
@ -731,19 +814,19 @@ Backpack.Active = true
|
||||||
makeTextLabel("LeftArmLabel","Left Arm",UDim2.new(0.5,-16,0,-25),leftArmButton)
|
makeTextLabel("LeftArmLabel","Left Arm",UDim2.new(0.5,-16,0,-25),leftArmButton)
|
||||||
|
|
||||||
local TShirtFrame = makeCharFrame("T-ShirtsFrame",CharacterPane)
|
local TShirtFrame = makeCharFrame("T-ShirtsFrame",CharacterPane)
|
||||||
game:GetService("ContentProvider"):Preload("http://morblox.us/asset/?id=75460642")
|
game:GetService("ContentProvider"):Preload("http://www.morblox.us/asset/?id=75460642")
|
||||||
makeZone("TShirtZone","http://morblox.us/asset/?id=75460642",UDim2.new(0,121,0,154),UDim2.new(0.5,-60,0.5,-100),TShirtFrame)
|
makeZone("TShirtZone","http://www.morblox.us/asset/?id=75460642",UDim2.new(0,121,0,154),UDim2.new(0.5,-60,0.5,-100),TShirtFrame)
|
||||||
makeStyledButton("TShirtButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),TShirtFrame)
|
makeStyledButton("TShirtButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),TShirtFrame)
|
||||||
|
|
||||||
|
|
||||||
local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane)
|
local ShirtFrame = makeCharFrame("ShirtsFrame", CharacterPane)
|
||||||
makeZone("ShirtZone","http://morblox.us/asset/?id=75460642",UDim2.new(0,121,0,154),UDim2.new(0.5,-60,0.5,-100),ShirtFrame)
|
makeZone("ShirtZone","http://www.morblox.us/asset/?id=75460642",UDim2.new(0,121,0,154),UDim2.new(0.5,-60,0.5,-100),ShirtFrame)
|
||||||
makeStyledButton("ShirtButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),ShirtFrame)
|
makeStyledButton("ShirtButton", UDim2.new(0,64,0,64),UDim2.new(0.5,-32,0.5,-64),ShirtFrame)
|
||||||
|
|
||||||
|
|
||||||
local ColorFrame = makeCharFrame("ColorFrame", CharacterPane)
|
local ColorFrame = makeCharFrame("ColorFrame", CharacterPane)
|
||||||
game:GetService("ContentProvider"):Preload("http://morblox.us/asset/?id=76049888")
|
game:GetService("ContentProvider"):Preload("http://www.morblox.us/asset/?id=76049888")
|
||||||
local ColorZone = makeZone("ColorZone","http://morblox.us/asset/?id=76049888", UDim2.new(0,120,0,150),UDim2.new(0.5,-60,0.5,-100),ColorFrame)
|
local ColorZone = makeZone("ColorZone","http://www.morblox.us/asset/?id=76049888", UDim2.new(0,120,0,150),UDim2.new(0.5,-60,0.5,-100),ColorFrame)
|
||||||
makeStyledButton("Head",UDim2.new(0.26,0,0.19,0),UDim2.new(0.37,0,0.02,0),ColorZone).AutoButtonColor = false
|
makeStyledButton("Head",UDim2.new(0.26,0,0.19,0),UDim2.new(0.37,0,0.02,0),ColorZone).AutoButtonColor = false
|
||||||
makeStyledButton("LeftArm",UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26,0),ColorZone).AutoButtonColor = false
|
makeStyledButton("LeftArm",UDim2.new(0.19,0,0.36,0),UDim2.new(0.78,0,0.26,0),ColorZone).AutoButtonColor = false
|
||||||
makeStyledButton("RightArm",UDim2.new(0.19,0,0.36,0),UDim2.new(0.025,0,0.26,0),ColorZone).AutoButtonColor = false
|
makeStyledButton("RightArm",UDim2.new(0.19,0,0.36,0),UDim2.new(0.025,0,0.26,0),ColorZone).AutoButtonColor = false
|
||||||
|
|
@ -780,4 +863,5 @@ Backpack.Active = true
|
||||||
SaveButton.Parent = CharacterPane
|
SaveButton.Parent = CharacterPane
|
||||||
|
|
||||||
-- no need for this to stick around
|
-- no need for this to stick around
|
||||||
script:remove()
|
|
||||||
|
script:Destroy()
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%13%
|
%13%
|
||||||
-- This script manages context switches in the backpack (Gear to Wardrobe, etc.) and player state changes. Also manages global functions across different tabs (currently only search)
|
-- This script manages context switches in the backpack (Gear to Wardrobe, etc.) and player state changes. Also manages global functions across different tabs (currently only search)
|
||||||
if game.CoreGui.Version < 7 then return end -- peace out if we aren't using the right client
|
if game.CoreGui.Version < 7 then return end -- peace out if we aren't using the right client
|
||||||
|
|
||||||
|
|
@ -40,10 +40,10 @@ local closeButton = backpack.Tabs.CloseButton
|
||||||
|
|
||||||
waitForChild(backpack.Tabs, "InventoryButton")
|
waitForChild(backpack.Tabs, "InventoryButton")
|
||||||
local inventoryButton = backpack.Tabs.InventoryButton
|
local inventoryButton = backpack.Tabs.InventoryButton
|
||||||
|
if game.CoreGui.Version >= 8 then
|
||||||
waitForChild(backpack.Tabs, "WardrobeButton")
|
waitForChild(backpack.Tabs, "WardrobeButton")
|
||||||
local wardrobeButton = backpack.Tabs.WardrobeButton
|
local wardrobeButton = backpack.Tabs.WardrobeButton
|
||||||
|
end
|
||||||
waitForChild(backpack.Parent,"ControlFrame")
|
waitForChild(backpack.Parent,"ControlFrame")
|
||||||
local backpackButton = waitForChild(backpack.Parent.ControlFrame,"BackpackButton")
|
local backpackButton = waitForChild(backpack.Parent.ControlFrame,"BackpackButton")
|
||||||
local currentTab = "gear"
|
local currentTab = "gear"
|
||||||
|
|
@ -54,6 +54,10 @@ local searchBox = waitForChild(backpack.SearchFrame.SearchBoxFrame,"SearchBox")
|
||||||
local searchButton = waitForChild(backpack.SearchFrame,"SearchButton")
|
local searchButton = waitForChild(backpack.SearchFrame,"SearchButton")
|
||||||
local resetButton = waitForChild(backpack.SearchFrame,"ResetButton")
|
local resetButton = waitForChild(backpack.SearchFrame,"ResetButton")
|
||||||
|
|
||||||
|
local robloxGui = waitForChild(Game.CoreGui, 'RobloxGui')
|
||||||
|
local currentLoadout = waitForChild(robloxGui, 'CurrentLoadout')
|
||||||
|
local loadoutBackground = waitForChild(currentLoadout, 'Background')
|
||||||
|
|
||||||
local canToggle = true
|
local canToggle = true
|
||||||
local readyForNextEvent = true
|
local readyForNextEvent = true
|
||||||
local backpackIsOpen = false
|
local backpackIsOpen = false
|
||||||
|
|
@ -61,12 +65,20 @@ local active = true
|
||||||
|
|
||||||
local humanoidDiedCon = nil
|
local humanoidDiedCon = nil
|
||||||
|
|
||||||
|
local backpackButtonPos
|
||||||
|
|
||||||
local guiTweenSpeed = 0.25 -- how quickly we open/close the backpack
|
local guiTweenSpeed = 0.25 -- how quickly we open/close the backpack
|
||||||
|
|
||||||
local searchDefaultText = "Search..."
|
local searchDefaultText = "Search..."
|
||||||
local tilde = "~"
|
local tilde = "~"
|
||||||
local backquote = "`"
|
local backquote = "`"
|
||||||
|
|
||||||
|
local backpackSize = UDim2.new(0, 600, 0, 400)
|
||||||
|
|
||||||
|
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||||
|
backpackSize = UDim2.new(0, 200, 0, 140)
|
||||||
|
end
|
||||||
|
|
||||||
------------------------ End Locals ---------------------------
|
------------------------ End Locals ---------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -118,6 +130,9 @@ function activateBackpack()
|
||||||
initHumanoidDiedConnections()
|
initHumanoidDiedConnections()
|
||||||
active = true
|
active = true
|
||||||
backpack.Visible = backpackIsOpen
|
backpack.Visible = backpackIsOpen
|
||||||
|
if backpackIsOpen then
|
||||||
|
toggleBackpack()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function initHumanoidDiedConnections()
|
function initHumanoidDiedConnections()
|
||||||
|
|
@ -137,7 +152,7 @@ local hideBackpack = function()
|
||||||
backpackCloseEvent:Fire(currentTab)
|
backpackCloseEvent:Fire(currentTab)
|
||||||
backpack.Tabs.Visible = false
|
backpack.Tabs.Visible = false
|
||||||
searchFrame.Visible = false
|
searchFrame.Visible = false
|
||||||
backpack:TweenSizeAndPosition(UDim2.new(0,0,0,0),UDim2.new(0.5,0,0.5,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true,
|
backpack:TweenSizeAndPosition(UDim2.new(0, backpackSize.X.Offset,0, 0), UDim2.new(0.5, -backpackSize.X.Offset/2, 1, -85), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true,
|
||||||
function()
|
function()
|
||||||
game.GuiService:RemoveCenterDialog(backpack)
|
game.GuiService:RemoveCenterDialog(backpack)
|
||||||
backpack.Visible = false
|
backpack.Visible = false
|
||||||
|
|
@ -147,6 +162,7 @@ local hideBackpack = function()
|
||||||
game.GuiService:RemoveCenterDialog(backpack)
|
game.GuiService:RemoveCenterDialog(backpack)
|
||||||
backpack.Visible = false
|
backpack.Visible = false
|
||||||
backpackButton.Selected = false
|
backpackButton.Selected = false
|
||||||
|
readyForNextEvent = true
|
||||||
canToggle = true
|
canToggle = true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -162,20 +178,22 @@ function showBackpack()
|
||||||
backpackButton.Selected = false
|
backpackButton.Selected = false
|
||||||
end)
|
end)
|
||||||
backpack.Visible = true
|
backpack.Visible = true
|
||||||
backpackButton.Selected = true
|
backpackButton.Selected = true
|
||||||
backpack:TweenSizeAndPosition(UDim2.new(0.55, 0, 0.76, 0),UDim2.new(0.225, 0, 0.09, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true)
|
backpack:TweenSizeAndPosition(backpackSize, UDim2.new(0.5, -backpackSize.X.Offset/2, 1, -backpackSize.Y.Offset - 88), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, guiTweenSpeed, true)
|
||||||
delay(guiTweenSpeed,function()
|
delay(guiTweenSpeed,function()
|
||||||
backpack.Tabs.Visible = true
|
backpack.Tabs.Visible = false
|
||||||
searchFrame.Visible = true
|
searchFrame.Visible = true
|
||||||
backpackOpenEvent:Fire(currentTab)
|
backpackOpenEvent:Fire(currentTab)
|
||||||
canToggle = true
|
canToggle = true
|
||||||
|
readyForNextEvent = true
|
||||||
|
backpackButton.Image = 'http://www.morblox.us/asset/?id=97644093'
|
||||||
|
backpackButton.Position = UDim2.new(0.5, -60, 1, -backpackSize.Y.Offset - 103)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function toggleBackpack()
|
function toggleBackpack()
|
||||||
if not game.Players.LocalPlayer then return end
|
if not game.Players.LocalPlayer then return end
|
||||||
if not game.Players.LocalPlayer["Character"] then return end
|
if not game.Players.LocalPlayer["Character"] then return end
|
||||||
|
|
||||||
if not canToggle then return end
|
if not canToggle then return end
|
||||||
if not readyForNextEvent then return end
|
if not readyForNextEvent then return end
|
||||||
readyForNextEvent = false
|
readyForNextEvent = false
|
||||||
|
|
@ -183,11 +201,42 @@ function toggleBackpack()
|
||||||
|
|
||||||
backpackIsOpen = not backpackIsOpen
|
backpackIsOpen = not backpackIsOpen
|
||||||
|
|
||||||
if backpackIsOpen then
|
if backpackIsOpen then
|
||||||
|
loadoutBackground.Image = 'http://www.morblox.us/asset/?id=97623721'
|
||||||
|
loadoutBackground.Position = UDim2.new(-0.03, 0, -0.17, 0)
|
||||||
|
loadoutBackground.Size = UDim2.new(1.05, 0, 1.25, 0)
|
||||||
|
loadoutBackground.ZIndex = 2.0
|
||||||
|
loadoutBackground.Visible = true
|
||||||
|
--backpackButton.Position = UDim2.new(0.5, -60, 1, -503)
|
||||||
showBackpack()
|
showBackpack()
|
||||||
else
|
else
|
||||||
backpackButton.Selected = false
|
backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
|
||||||
|
loadoutBackground.Visible = false
|
||||||
|
backpackButton.Selected = false
|
||||||
|
backpackButton.Image = "http://www.morblox.us/asset/?id=97617958"
|
||||||
|
loadoutBackground.Image = 'http://www.morblox.us/asset/?id=96536002'
|
||||||
|
loadoutBackground.Position = UDim2.new(-0.1, 0, -0.1, 0)
|
||||||
|
loadoutBackground.Size = UDim2.new(1.2, 0, 1.2, 0)
|
||||||
hideBackpack()
|
hideBackpack()
|
||||||
|
|
||||||
|
|
||||||
|
local clChildren = currentLoadout:GetChildren()
|
||||||
|
for i = 1, #clChildren do
|
||||||
|
if clChildren[i] and clChildren[i]:IsA('Frame') then
|
||||||
|
local frame = clChildren[i]
|
||||||
|
if #frame:GetChildren() > 0 then
|
||||||
|
backpackButton.Position = UDim2.new(0.5, -60, 1, -108)
|
||||||
|
backpackButton.Visible = true
|
||||||
|
loadoutBackground.Visible = true
|
||||||
|
if frame:GetChildren()[1]:IsA('ImageButton') then
|
||||||
|
local imgButton = frame:GetChildren()[1]
|
||||||
|
imgButton.Active = true
|
||||||
|
imgButton.Draggable = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -314,9 +363,11 @@ inventoryButton.MouseButton1Click:connect(function() newTabClicked("gear") end)
|
||||||
inventoryButton.MouseEnter:connect(function() mouseOverTab(inventoryButton) end)
|
inventoryButton.MouseEnter:connect(function() mouseOverTab(inventoryButton) end)
|
||||||
inventoryButton.MouseLeave:connect(function() mouseLeaveTab(inventoryButton) end)
|
inventoryButton.MouseLeave:connect(function() mouseLeaveTab(inventoryButton) end)
|
||||||
|
|
||||||
wardrobeButton.MouseButton1Click:connect(function() newTabClicked("wardrobe") end)
|
if game.CoreGui.Version >= 8 then
|
||||||
wardrobeButton.MouseEnter:connect(function() mouseOverTab(wardrobeButton) end)
|
wardrobeButton.MouseButton1Click:connect(function() newTabClicked("wardrobe") end)
|
||||||
wardrobeButton.MouseLeave:connect(function() mouseLeaveTab(wardrobeButton) end)
|
wardrobeButton.MouseEnter:connect(function() mouseOverTab(wardrobeButton) end)
|
||||||
|
wardrobeButton.MouseLeave:connect(function() mouseLeaveTab(wardrobeButton) end)
|
||||||
|
end
|
||||||
|
|
||||||
closeButton.MouseButton1Click:connect(closeBackpack)
|
closeButton.MouseButton1Click:connect(closeBackpack)
|
||||||
|
|
||||||
|
|
@ -343,6 +394,7 @@ end)
|
||||||
if game.Players.LocalPlayer["Character"] then
|
if game.Players.LocalPlayer["Character"] then
|
||||||
activateBackpack()
|
activateBackpack()
|
||||||
end
|
end
|
||||||
|
|
||||||
game.Players.LocalPlayer.CharacterAdded:connect(activateBackpack)
|
game.Players.LocalPlayer.CharacterAdded:connect(activateBackpack)
|
||||||
|
|
||||||
-- search functions
|
-- search functions
|
||||||
|
|
@ -356,4 +408,9 @@ end)
|
||||||
searchButton.MouseButton1Click:connect(doSearch)
|
searchButton.MouseButton1Click:connect(doSearch)
|
||||||
resetButton.MouseButton1Click:connect(resetSearch)
|
resetButton.MouseButton1Click:connect(resetSearch)
|
||||||
|
|
||||||
backpackButton.Visible = true
|
if searchFrame and robloxGui.AbsoluteSize.Y <= 320 then
|
||||||
|
searchFrame.RobloxLocked = false
|
||||||
|
searchFrame:Destroy()
|
||||||
|
end
|
||||||
|
|
||||||
|
--backpackButton.Visible = true
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
%14%
|
%14%
|
||||||
-- A couple of necessary functions
|
-- A couple of necessary functions
|
||||||
local function waitForChild(instance, name)
|
local function waitForChild(instance, name)
|
||||||
assert(instance)
|
assert(instance)
|
||||||
assert(name)
|
assert(name)
|
||||||
while not instance:FindFirstChild(name) do
|
while not instance:FindFirstChild(name) do
|
||||||
|
print('Waiting for ...', instance, name)
|
||||||
instance.ChildAdded:wait()
|
instance.ChildAdded:wait()
|
||||||
end
|
end
|
||||||
return instance:FindFirstChild(name)
|
return instance:FindFirstChild(name)
|
||||||
|
|
@ -16,6 +17,13 @@ local function waitForProperty(instance, property)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function IsTouchDevice()
|
||||||
|
local touchEnabled = false
|
||||||
|
pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end)
|
||||||
|
return touchEnabled
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
waitForChild(game,"Players")
|
waitForChild(game,"Players")
|
||||||
waitForProperty(game.Players,"LocalPlayer")
|
waitForProperty(game.Players,"LocalPlayer")
|
||||||
local player = game.Players.LocalPlayer
|
local player = game.Players.LocalPlayer
|
||||||
|
|
@ -67,7 +75,7 @@ local searchRequestedEvent = waitForChild(backpackManager,"SearchRequestedEvent"
|
||||||
local tellBackpackReadyFunc = waitForChild(backpackManager,"BackpackReady")
|
local tellBackpackReadyFunc = waitForChild(backpackManager,"BackpackReady")
|
||||||
|
|
||||||
-- creating scroll bar early as to make sure items get placed correctly
|
-- creating scroll bar early as to make sure items get placed correctly
|
||||||
local scrollFrame, scrollUp, scrollDown, recalculateScroll = RbxGui.CreateScrollingFrame(nil,"grid")
|
local scrollFrame, scrollUp, scrollDown, recalculateScroll = RbxGui.CreateScrollingFrame(nil, "grid", Vector2.new(6, 6))
|
||||||
|
|
||||||
scrollFrame.Position = UDim2.new(0,0,0,30)
|
scrollFrame.Position = UDim2.new(0,0,0,30)
|
||||||
scrollFrame.Size = UDim2.new(1,0,1,-30)
|
scrollFrame.Size = UDim2.new(1,0,1,-30)
|
||||||
|
|
@ -236,6 +244,7 @@ end
|
||||||
|
|
||||||
function previewGear(button)
|
function previewGear(button)
|
||||||
if not browsingMenu then
|
if not browsingMenu then
|
||||||
|
gearPreview.Visible = false
|
||||||
gearPreview.GearImage.Image = button.Image
|
gearPreview.GearImage.Image = button.Image
|
||||||
gearPreview.GearStats.GearName.Text = button.GearReference.Value.Name
|
gearPreview.GearStats.GearName.Text = button.GearReference.Value.Name
|
||||||
end
|
end
|
||||||
|
|
@ -276,7 +285,7 @@ end
|
||||||
function resizeGrid()
|
function resizeGrid()
|
||||||
for k,v in pairs(backpackItems) do
|
for k,v in pairs(backpackItems) do
|
||||||
if not v:FindFirstChild("RobloxBuildTool") then
|
if not v:FindFirstChild("RobloxBuildTool") then
|
||||||
if not buttons[v] then
|
if not buttons[v] then
|
||||||
local buttonClone = gearButton:clone()
|
local buttonClone = gearButton:clone()
|
||||||
buttonClone.Parent = grid.ScrollingFrame
|
buttonClone.Parent = grid.ScrollingFrame
|
||||||
buttonClone.Visible = true
|
buttonClone.Visible = true
|
||||||
|
|
@ -289,18 +298,26 @@ function resizeGrid()
|
||||||
buttonClone.Draggable = true
|
buttonClone.Draggable = true
|
||||||
buttons[v] = buttonClone
|
buttons[v] = buttonClone
|
||||||
|
|
||||||
local unequipMenu = getGearContextMenu()
|
|
||||||
|
if not IsTouchDevice() then
|
||||||
|
local unequipMenu = getGearContextMenu()
|
||||||
|
|
||||||
|
|
||||||
unequipMenu.Visible = false
|
unequipMenu.Visible = false
|
||||||
unequipMenu.Parent = buttonClone
|
unequipMenu.Parent = buttonClone
|
||||||
|
end
|
||||||
|
|
||||||
local beginPos = nil
|
local beginPos = nil
|
||||||
buttonClone.DragBegin:connect(function(value)
|
buttonClone.DragBegin:connect(function(value)
|
||||||
buttonClone.ZIndex = 9
|
waitForChild(buttonClone, 'Background')
|
||||||
|
buttonClone['Background'].ZIndex = 10
|
||||||
|
buttonClone.ZIndex = 10
|
||||||
beginPos = value
|
beginPos = value
|
||||||
end)
|
end)
|
||||||
buttonClone.DragStopped:connect(function(x,y)
|
buttonClone.DragStopped:connect(function(x,y)
|
||||||
buttonClone.ZIndex = 1
|
waitForChild(buttonClone, 'Background')
|
||||||
|
buttonClone['Background'].ZIndex = 1.0
|
||||||
|
buttonClone.ZIndex = 2
|
||||||
if beginPos ~= buttonClone.Position then
|
if beginPos ~= buttonClone.Position then
|
||||||
if not checkForSwap(buttonClone,x,y) then
|
if not checkForSwap(buttonClone,x,y) then
|
||||||
buttonClone:TweenPosition(beginPos,Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
|
buttonClone:TweenPosition(beginPos,Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, true)
|
||||||
|
|
@ -622,7 +639,7 @@ function nukeBackpack()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function getGearContextMenu()
|
function getGearContextMenu()
|
||||||
local gearContextMenu = Instance.new("Frame")
|
local gearContextMenu = Instance.new("Frame")
|
||||||
gearContextMenu.Active = true
|
gearContextMenu.Active = true
|
||||||
gearContextMenu.Name = "UnequipContextMenu"
|
gearContextMenu.Name = "UnequipContextMenu"
|
||||||
|
|
@ -671,27 +688,30 @@ function getGearContextMenu()
|
||||||
button.ZIndex = 9
|
button.ZIndex = 9
|
||||||
button.Parent = gearContextMenuButton
|
button.Parent = gearContextMenuButton
|
||||||
|
|
||||||
button.MouseButton1Click:connect(function()
|
if not IsTouchDevice() then
|
||||||
if button.Active and not gearContextMenu.Parent.Active then
|
|
||||||
local success, result = pcall(function() element.DoIt(element, gearContextMenu) end)
|
button.MouseButton1Click:connect(function()
|
||||||
browsingMenu = false
|
if button.Active and not gearContextMenu.Parent.Active then
|
||||||
gearContextMenu.Visible = false
|
local success, result = pcall(function() element.DoIt(element, gearContextMenu) end)
|
||||||
clearHighlight(button)
|
browsingMenu = false
|
||||||
clearPreview()
|
gearContextMenu.Visible = false
|
||||||
end
|
clearHighlight(button)
|
||||||
end)
|
clearPreview()
|
||||||
|
end
|
||||||
button.MouseEnter:connect(function()
|
end)
|
||||||
if button.Active and gearContextMenu.Parent.Active then
|
|
||||||
highlight(button)
|
button.MouseEnter:connect(function()
|
||||||
end
|
if button.Active and gearContextMenu.Parent.Active then
|
||||||
end)
|
highlight(button)
|
||||||
button.MouseLeave:connect(function()
|
end
|
||||||
if button.Active and gearContextMenu.Parent.Active then
|
end)
|
||||||
clearHighlight(button)
|
button.MouseLeave:connect(function()
|
||||||
end
|
if button.Active and gearContextMenu.Parent.Active then
|
||||||
end)
|
clearHighlight(button)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
contextElement.Button = button
|
contextElement.Button = button
|
||||||
contextElement.Element = button
|
contextElement.Element = button
|
||||||
elseif element.Type == "Label" then
|
elseif element.Type == "Label" then
|
||||||
|
|
|
||||||
226
public/asset/15
226
public/asset/15
|
|
@ -1,4 +1,4 @@
|
||||||
%15%
|
%15%
|
||||||
if game.CoreGui.Version < 3 then return end -- peace out if we aren't using the right client
|
if game.CoreGui.Version < 3 then return end -- peace out if we aren't using the right client
|
||||||
|
|
||||||
-- A couple of necessary functions
|
-- A couple of necessary functions
|
||||||
|
|
@ -19,16 +19,47 @@ local StaticTabName = "gear"
|
||||||
|
|
||||||
local robloxGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
|
local robloxGui = game:GetService("CoreGui"):FindFirstChild("RobloxGui")
|
||||||
assert(robloxGui)
|
assert(robloxGui)
|
||||||
|
local controlFrame = waitForChild(robloxGui, 'ControlFrame')
|
||||||
|
local backpackButton = waitForChild(controlFrame, 'BackpackButton')
|
||||||
|
local backpack = waitForChild(robloxGui, 'Backpack')
|
||||||
waitForChild(robloxGui,"CurrentLoadout")
|
waitForChild(robloxGui,"CurrentLoadout")
|
||||||
waitForChild(robloxGui.CurrentLoadout,"TempSlot")
|
waitForChild(robloxGui.CurrentLoadout,"TempSlot")
|
||||||
waitForChild(robloxGui.CurrentLoadout.TempSlot,"SlotNumber")
|
waitForChild(robloxGui.CurrentLoadout.TempSlot,"SlotNumber")
|
||||||
|
|
||||||
|
waitForChild(currentLoadout, 'Background')
|
||||||
|
local clBackground = currentLoadout.Background
|
||||||
|
|
||||||
|
local function IsTouchDevice()
|
||||||
|
local touchEnabled = false
|
||||||
|
pcall(function() touchEnabled = Game:GetService('UserInputService').TouchEnabled end)
|
||||||
|
return touchEnabled
|
||||||
|
end
|
||||||
|
|
||||||
|
local function moveHealthBar(pGui)
|
||||||
|
waitForChild(pGui, 'HealthGUI')
|
||||||
|
waitForChild(pGui['HealthGUI'], 'tray')
|
||||||
|
local tray = pGui['HealthGUI']['tray']
|
||||||
|
tray.Position = UDim2.new(0.5, -85, 1, -26)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Begin Locals
|
--- Begin Locals
|
||||||
waitForChild(game,"Players")
|
waitForChild(game,"Players")
|
||||||
waitForProperty(game.Players,"LocalPlayer")
|
waitForProperty(game.Players,"LocalPlayer")
|
||||||
local player = game.Players.LocalPlayer
|
local player = game.Players.LocalPlayer
|
||||||
|
|
||||||
|
waitForChild(player, 'PlayerGui')
|
||||||
|
Spawn(function()
|
||||||
|
moveHealthBar(player.PlayerGui)
|
||||||
|
end)
|
||||||
|
|
||||||
|
while player.Character == nil do wait(0.03) end
|
||||||
|
local humanoid = waitForChild(player.Character, 'Humanoid')
|
||||||
|
humanoid.Died:connect(function()
|
||||||
|
backpackButton.Visible = false
|
||||||
|
end)
|
||||||
|
|
||||||
waitForChild(game, "LocalBackpack")
|
waitForChild(game, "LocalBackpack")
|
||||||
game.LocalBackpack:SetOldSchoolBackpack(false)
|
game.LocalBackpack:SetOldSchoolBackpack(false)
|
||||||
|
|
||||||
|
|
@ -44,6 +75,10 @@ local resizeEvent = waitForChild(backpackManager,"ResizeEvent")
|
||||||
local inGearTab = true
|
local inGearTab = true
|
||||||
|
|
||||||
local maxNumLoadoutItems = 10
|
local maxNumLoadoutItems = 10
|
||||||
|
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||||
|
maxNumLoadoutItems = 4
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local characterChildAddedCon = nil
|
local characterChildAddedCon = nil
|
||||||
local backpackChildCon = nil
|
local backpackChildCon = nil
|
||||||
|
|
@ -56,6 +91,8 @@ local buttonSizeNormal = UDim2.new(1,0,1,0)
|
||||||
local enlargeOverride = true
|
local enlargeOverride = true
|
||||||
local guiTweenSpeed = 0.5
|
local guiTweenSpeed = 0.5
|
||||||
|
|
||||||
|
local firstInstanceOfLoadout = false
|
||||||
|
|
||||||
local inventory = {}
|
local inventory = {}
|
||||||
|
|
||||||
for i = 0, 9 do
|
for i = 0, 9 do
|
||||||
|
|
@ -66,6 +103,8 @@ local gearSlots = {}
|
||||||
for i = 1, maxNumLoadoutItems do
|
for i = 1, maxNumLoadoutItems do
|
||||||
gearSlots[i] = "empty"
|
gearSlots[i] = "empty"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local backpackWasOpened = false
|
||||||
--- End Locals
|
--- End Locals
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -74,6 +113,14 @@ end
|
||||||
|
|
||||||
|
|
||||||
-- Begin Functions
|
-- Begin Functions
|
||||||
|
local function backpackIsOpen()
|
||||||
|
if guiBackpack then
|
||||||
|
return guiBackpack.Visible
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function kill(prop,con,gear)
|
local function kill(prop,con,gear)
|
||||||
if con then con:disconnect() end
|
if con then con:disconnect() end
|
||||||
if prop == true and gear then
|
if prop == true and gear then
|
||||||
|
|
@ -118,15 +165,35 @@ function removeGear(gear)
|
||||||
gearSlots[emptySlot] = "empty"
|
gearSlots[emptySlot] = "empty"
|
||||||
|
|
||||||
local centerizeX = gear.Size.X.Scale/2
|
local centerizeX = gear.Size.X.Scale/2
|
||||||
local centerizeY = gear.Size.Y.Scale/2
|
local centerizeY = gear.Size.Y.Scale/2
|
||||||
gear:TweenSizeAndPosition(UDim2.new(0,0,0,0),
|
--[[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),
|
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)
|
Enum.EasingDirection.Out, Enum.EasingStyle.Quad,guiTweenSpeed/4,true)]]
|
||||||
delay(guiTweenSpeed/2,
|
delay(0,
|
||||||
function()
|
function()
|
||||||
gear:remove()
|
gear:remove()
|
||||||
end)
|
end)
|
||||||
end
|
|
||||||
|
Spawn(function()
|
||||||
|
while backpackIsOpen() do wait(0.03) end
|
||||||
|
waitForChild(player, 'Backpack')
|
||||||
|
local allEmpty = true
|
||||||
|
for i = 1, #gearSlots do
|
||||||
|
if gearSlots[i] ~= 'empty' then
|
||||||
|
allEmpty = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if allEmpty then
|
||||||
|
if #player.Backpack:GetChildren() < 1 then
|
||||||
|
backpackButton.Visible = false
|
||||||
|
else
|
||||||
|
backpackButton.Position = UDim2.new(0.5, -60, 1, -44)
|
||||||
|
end
|
||||||
|
clBackground.Visible = false
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function insertGear(gear, addToSlot)
|
function insertGear(gear, addToSlot)
|
||||||
|
|
@ -320,8 +387,12 @@ enlargeButton = function(button)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if button:FindFirstChild('Highlight') then
|
||||||
|
button.Highlight.Visible = true
|
||||||
|
end
|
||||||
|
|
||||||
if button:IsA("ImageButton") or button:IsA("TextButton") then
|
if button:IsA("ImageButton") or button:IsA("TextButton") then
|
||||||
button.ZIndex = 2
|
button.ZIndex = 5
|
||||||
local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale)/2
|
local centerizeX = -(buttonSizeEnlarge.X.Scale - button.Size.X.Scale)/2
|
||||||
local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale)/2
|
local centerizeY = -(buttonSizeEnlarge.Y.Scale - button.Size.Y.Scale)/2
|
||||||
button:TweenSizeAndPosition(buttonSizeEnlarge,
|
button:TweenSizeAndPosition(buttonSizeEnlarge,
|
||||||
|
|
@ -349,6 +420,10 @@ normalizeButton = function(button, speed)
|
||||||
local moveSpeed = speed
|
local moveSpeed = speed
|
||||||
if moveSpeed == nil or type(moveSpeed) ~= "number" then moveSpeed = guiTweenSpeed/5 end
|
if moveSpeed == nil or type(moveSpeed) ~= "number" then moveSpeed = guiTweenSpeed/5 end
|
||||||
|
|
||||||
|
if button:FindFirstChild('Highlight') then
|
||||||
|
button.Highlight.Visible = false
|
||||||
|
end
|
||||||
|
|
||||||
if button:IsA("ImageButton") or button:IsA("TextButton") then
|
if button:IsA("ImageButton") or button:IsA("TextButton") then
|
||||||
button.ZIndex = 1
|
button.ZIndex = 1
|
||||||
local inverseEnlarge = 1/enlargeFactor
|
local inverseEnlarge = 1/enlargeFactor
|
||||||
|
|
@ -463,7 +538,7 @@ function unequipAllItems(dontEquipThis)
|
||||||
end
|
end
|
||||||
|
|
||||||
function showToolTip(button, tip)
|
function showToolTip(button, tip)
|
||||||
if button and button:FindFirstChild("ToolTipLabel") and button.ToolTipLabel:IsA("TextLabel") then
|
if button and button:FindFirstChild("ToolTipLabel") and button.ToolTipLabel:IsA("TextLabel") and not IsTouchDevice() then
|
||||||
button.ToolTipLabel.Text = tostring(tip)
|
button.ToolTipLabel.Text = tostring(tip)
|
||||||
local xSize = button.ToolTipLabel.TextBounds.X + 6
|
local xSize = button.ToolTipLabel.TextBounds.X + 6
|
||||||
button.ToolTipLabel.Size = UDim2.new(0,xSize,0,20)
|
button.ToolTipLabel.Size = UDim2.new(0,xSize,0,20)
|
||||||
|
|
@ -478,7 +553,7 @@ function hideToolTip(button, tip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton)
|
local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButton)
|
||||||
waitForDebounce()
|
waitForDebounce()
|
||||||
debounce = true
|
debounce = true
|
||||||
|
|
||||||
|
|
@ -495,11 +570,10 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
|
||||||
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing
|
if gearSlots[i] ~= "empty" and gearSlots[i].GearReference.Value == child then -- we already have gear, do nothing
|
||||||
debounce = false
|
debounce = false
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local gearClone = currentLoadout.TempSlot:clone()
|
local gearClone = currentLoadout.TempSlot:clone()
|
||||||
gearClone.Name = child.Name
|
gearClone.Name = child.Name
|
||||||
gearClone.GearImage.Image = child.TextureId
|
gearClone.GearImage.Image = child.TextureId
|
||||||
|
|
@ -586,8 +660,8 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
dragBegin = gearClone.DragBegin:connect(function(pos)
|
dragBegin = gearClone.DragBegin:connect(function(pos)
|
||||||
dragBeginPos = pos
|
dragBeginPos = pos
|
||||||
gearClone.ZIndex = 7
|
gearClone.ZIndex = 7
|
||||||
local children = gearClone:GetChildren()
|
local children = gearClone:GetChildren()
|
||||||
for i = 1, #children do
|
for i = 1, #children do
|
||||||
if children[i]:IsA("TextLabel") then
|
if children[i]:IsA("TextLabel") then
|
||||||
|
|
@ -603,9 +677,9 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
|
||||||
end)
|
end)
|
||||||
dragStop = gearClone.DragStopped:connect(function(x,y)
|
dragStop = gearClone.DragStopped:connect(function(x,y)
|
||||||
if gearClone.Selected then
|
if gearClone.Selected then
|
||||||
gearClone.ZIndex = 2
|
gearClone.ZIndex = 4
|
||||||
else
|
else
|
||||||
gearClone.ZIndex = 1
|
gearClone.ZIndex = 3
|
||||||
end
|
end
|
||||||
local children = gearClone:GetChildren()
|
local children = gearClone:GetChildren()
|
||||||
for i = 1, #children do
|
for i = 1, #children do
|
||||||
|
|
@ -665,6 +739,16 @@ local addingPlayerChild = function(child, equipped, addToSlot, inventoryGearButt
|
||||||
|
|
||||||
debounce = false
|
debounce = false
|
||||||
|
|
||||||
|
Spawn(function()
|
||||||
|
while backpackIsOpen() do wait(0.03) end
|
||||||
|
for i = 1, #gearSlots do
|
||||||
|
if gearSlots[i] ~= 'empty' then
|
||||||
|
backpackButton.Position = UDim2.new(0.5, -60, 1, -108)
|
||||||
|
backpackButton.Visible = true
|
||||||
|
clBackground.Visible = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function addToInventory(child)
|
function addToInventory(child)
|
||||||
|
|
@ -700,8 +784,12 @@ local spreadOutGear = function()
|
||||||
if loadoutChildren[i]:IsA("Frame") then
|
if loadoutChildren[i]:IsA("Frame") then
|
||||||
loadoutChildren[i].BackgroundTransparency = 0.5
|
loadoutChildren[i].BackgroundTransparency = 0.5
|
||||||
local slot = tonumber(string.sub(loadoutChildren[i].Name,5))
|
local slot = tonumber(string.sub(loadoutChildren[i].Name,5))
|
||||||
if slot == 0 then slot = 10 end
|
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)
|
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||||
|
loadoutChildren[i]:TweenPosition(UDim2.new(0,(slot-1) * 60,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
|
||||||
|
else
|
||||||
|
loadoutChildren[i]:TweenPosition(UDim2.new((slot - 1)/10,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -709,7 +797,7 @@ end
|
||||||
local centerGear = function()
|
local centerGear = function()
|
||||||
loadoutChildren = currentLoadout:GetChildren()
|
loadoutChildren = currentLoadout:GetChildren()
|
||||||
local gearButtons = {}
|
local gearButtons = {}
|
||||||
local lastSlotAdd = nlii
|
local lastSlotAdd = nil
|
||||||
|
|
||||||
for i = 1, #loadoutChildren do
|
for i = 1, #loadoutChildren do
|
||||||
if loadoutChildren[i]:IsA("Frame") then
|
if loadoutChildren[i]:IsA("Frame") then
|
||||||
|
|
@ -726,12 +814,18 @@ local centerGear = function()
|
||||||
if lastSlotAdd then table.insert(gearButtons,lastSlotAdd) end
|
if lastSlotAdd then table.insert(gearButtons,lastSlotAdd) end
|
||||||
|
|
||||||
local startPos = ( 1 - (#gearButtons * 0.1) ) / 2
|
local startPos = ( 1 - (#gearButtons * 0.1) ) / 2
|
||||||
for i = 1, #gearButtons do
|
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)
|
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||||
|
startPos = ( 0.5 - (#gearButtons * 0.333)/2 )
|
||||||
|
gearButtons[i]:TweenPosition(UDim2.new(startPos + (i-1) * 0.33, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
|
||||||
|
else
|
||||||
|
gearButtons[i]:TweenPosition(UDim2.new(startPos + ((i - 1) * 0.1),0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function editLoadout()
|
function editLoadout()
|
||||||
|
backpackWasOpened = true
|
||||||
if inGearTab then
|
if inGearTab then
|
||||||
spreadOutGear()
|
spreadOutGear()
|
||||||
end
|
end
|
||||||
|
|
@ -743,12 +837,17 @@ function readonlyLoadout()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function setupBackpackListener()
|
function setupBackpackListener()
|
||||||
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
||||||
backpackChildCon = player.Backpack.ChildAdded:connect(function(child)
|
backpackChildCon = player.Backpack.ChildAdded:connect(function(child)
|
||||||
|
if not firstInstanceOfLoadout then
|
||||||
|
firstInstanceOfLoadout = true
|
||||||
|
backpackButton.Visible = true
|
||||||
|
clBackground.Visible = true
|
||||||
|
end
|
||||||
addingPlayerChild(child)
|
addingPlayerChild(child)
|
||||||
addToInventory(child)
|
addToInventory(child)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function playerCharacterChildAdded(child)
|
function playerCharacterChildAdded(child)
|
||||||
|
|
@ -784,12 +883,41 @@ wait() -- let stuff initialize incase this is first heartbeat...
|
||||||
|
|
||||||
waitForChild(player,"Backpack")
|
waitForChild(player,"Backpack")
|
||||||
waitForProperty(player,"Character")
|
waitForProperty(player,"Character")
|
||||||
local backpackChildren = player.Backpack:GetChildren()
|
|
||||||
local size = math.min(10,#backpackChildren)
|
-- not sure why this had no delay but the player.CharacterAdded one had one... this type of error would be easier to avoid with function reusage
|
||||||
for i = 1, size do
|
delay(1,function()
|
||||||
addingPlayerChild(backpackChildren[i],false)
|
local backpackChildren = player.Backpack:GetChildren()
|
||||||
end
|
local size = math.min(10,#backpackChildren)
|
||||||
setupBackpackListener()
|
for i = 1, size do
|
||||||
|
backpackButton.Visible = true
|
||||||
|
clBackground.Visible = true
|
||||||
|
addingPlayerChild(backpackChildren[i],false)
|
||||||
|
end
|
||||||
|
setupBackpackListener()
|
||||||
|
end)
|
||||||
|
|
||||||
|
delay(0, function()
|
||||||
|
for i = 1, 30 do
|
||||||
|
if not backpackWasOpened then
|
||||||
|
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||||
|
local cChildren = currentLoadout:GetChildren()
|
||||||
|
for i = 1, #cChildren do
|
||||||
|
local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name)))
|
||||||
|
if type(slotNum) == 'number' then
|
||||||
|
cChildren[i].Position = UDim2.new(0, (slotNum-1) * 60, 0, 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
wait(0.25)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
player.ChildAdded:connect(function(child)
|
||||||
|
if child:IsA('PlayerGui') then
|
||||||
|
moveHealthBar(child)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
waitForProperty(player,"Character")
|
waitForProperty(player,"Character")
|
||||||
for i,v in ipairs(player.Character:GetChildren()) do
|
for i,v in ipairs(player.Character:GetChildren()) do
|
||||||
|
|
@ -802,6 +930,7 @@ humanoidDiedCon = player.Character.Humanoid.Died:connect(function()
|
||||||
if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end
|
if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end
|
||||||
deactivateLoadout()
|
deactivateLoadout()
|
||||||
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
||||||
|
backpackWasOpened = false
|
||||||
end)
|
end)
|
||||||
|
|
||||||
player.CharacterRemoving:connect(function()
|
player.CharacterRemoving:connect(function()
|
||||||
|
|
@ -813,22 +942,24 @@ player.CharacterRemoving:connect(function()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
player.CharacterAdded:connect(function()
|
player.CharacterAdded:connect(function()
|
||||||
waitForProperty(game.Players,"LocalPlayer")
|
waitForProperty(game.Players,"LocalPlayer")
|
||||||
player = game.Players.LocalPlayer -- make sure we are still looking at the correct character
|
player = game.Players.LocalPlayer -- make sure we are still looking at the correct character
|
||||||
waitForChild(player,"Backpack")
|
waitForChild(player,"Backpack")
|
||||||
|
|
||||||
|
|
||||||
delay(1,function()
|
delay(1,function()
|
||||||
local backpackChildren = player.Backpack:GetChildren()
|
local backpackChildren = player.Backpack:GetChildren()
|
||||||
local size = math.min(10,#backpackChildren)
|
local size = math.min(10,#backpackChildren)
|
||||||
for i = 1, size do
|
for i = 1, size do
|
||||||
|
backpackButton.Visible = true
|
||||||
|
clBackground.Visible = true
|
||||||
addingPlayerChild(backpackChildren[i],false)
|
addingPlayerChild(backpackChildren[i],false)
|
||||||
end
|
end
|
||||||
setupBackpackListener()
|
setupBackpackListener()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
activateLoadout()
|
activateLoadout()
|
||||||
|
|
||||||
if characterChildAddedCon then
|
if characterChildAddedCon then
|
||||||
characterChildAddedCon:disconnect()
|
characterChildAddedCon:disconnect()
|
||||||
|
|
@ -841,14 +972,37 @@ player.CharacterAdded:connect(function()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
waitForChild(player.Character,"Humanoid")
|
waitForChild(player.Character,"Humanoid")
|
||||||
|
if backpack.Visible then
|
||||||
|
backpackOpenEvent:Fire()
|
||||||
|
end
|
||||||
humanoidDiedCon =
|
humanoidDiedCon =
|
||||||
player.Character.Humanoid.Died:connect(function()
|
player.Character.Humanoid.Died:connect(function()
|
||||||
deactivateLoadout()
|
backpackButton.Visible = false
|
||||||
|
clBackground.Visible = false
|
||||||
|
firstInstanceOfLoadout = false
|
||||||
|
deactivateLoadout()
|
||||||
|
|
||||||
if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end
|
if humanoidDiedCon then humanoidDiedCon:disconnect() humanoidDiedCon = nil end
|
||||||
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
if backpackChildCon then backpackChildCon:disconnect() backpackChildCon = nil end
|
||||||
end)
|
end)
|
||||||
|
waitForChild(player, 'PlayerGui')
|
||||||
|
moveHealthBar(player.PlayerGui)
|
||||||
|
delay(0, function()
|
||||||
|
for i = 1, 30 do
|
||||||
|
if not backpackWasOpened then
|
||||||
|
if robloxGui.AbsoluteSize.Y <= 320 then
|
||||||
|
local cChildren = currentLoadout:GetChildren()
|
||||||
|
for i = 1, #cChildren do
|
||||||
|
local slotNum = tonumber(string.sub(cChildren[i].Name, 5, string.len(cChildren[i].Name)))
|
||||||
|
if type(slotNum) == 'number' then
|
||||||
|
cChildren[i].Position = UDim2.new(0, (slotNum-1) * 60, 0, 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
wait(0.25)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
waitForChild(guiBackpack,"SwapSlot")
|
waitForChild(guiBackpack,"SwapSlot")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue