so, atm i have an inventory script i found and modified and it required u to push a button to open it....i was fine with this but redesigned how im using it and now i need it open by default.
so my question is, how would i modify this to make it stay open by default instead of needing to press a button first?
here is the script
wait(.5)
player = game.Players.LocalPlayer
game.StarterGui:SetCoreGuiEnabled('Backpack',false)
--
local Enabled = false
function UpdateInventory()
if Enabled == false then
Enabled = true
script.Parent.Frame.Visible = true
script.Parent.Frame.CanvasSize = UDim2.new(0,46*#player.Backpack:children(),0,0)
script.Parent.Frame:ClearAllChildren()
for i,v in pairs(player.Backpack:GetChildren()) do
Obj1 = Instance.new('ImageButton',script.Parent.Frame)
Obj1.ZIndex = 10
Obj1.Size = UDim2.new(0,40,0,40)
Obj1.Position = UDim2.new(0,45*i-40,0,7)
Obj1.BackgroundTransparency = 0
Obj1.Image = v.TextureId
Obj1.MouseButton1Down:connect(function()
player.Character.Humanoid:UnequipTools()
player.Character.Humanoid:EquipTool(v)
end)
end
else
Enabled = false
script.Parent.Frame.Visible = false
end
end
script.Parent.InvenButton.MouseButton1Down:connect(function()
UpdateInventory()
end)
player.Backpack.Changed:connect(function()
if Enabled == false then Enabled = true UpdateInventory() end
if Enabled == true then Enabled = false UpdateInventory() end
end)

1 comment
Just make it visible...