Im new to scripting but I am making retro survival game and I’ve grown to love the inventory style of deadzone classic. Can anyone help to get me started?
1 Like
This is how I make my inventory systems step by step:
- Create an Inventory folder inside the Player where all the items will be stored
- Clone a TextButton and place it inside of a ScrollingFrame everytime there is a new item in the Inventory Folder (and remove the TextButton when the item gets destroyed or removed from the folder)
Here is some code samples I wrote for you:
local Player = game.Players.LocalPlayer
local InventoryFolder = Player:WaitForChild("Inventory")
InventoryFolder.ChildAdded:Connect(function(Child)
local TextButton = script.ItemTemplate:Clone()
TextButton.Parent = script.Parent.Items -- 'Items' is a ScrollingFrame
TextButton.Name = Child.Name
TextButton.Text = Child.Name
end)
InventoryFolder.ChildRemoved:Connect(function(Child)
if script.Parent.Items:FindFirstChild(Child.Name) then
script.Parent.Items[Child.Name]:Destroy()
end
end)
this must be in a Local Script btw
Thank you! I made the ui what I only need to somehow limit how much people can pick up and also how can I make a hotbar so that there is a certain slot for that
1 Like
Im trying to create an exact replica of the Deadzone classic inventory system