#items system

1 messages · Page 1 of 1 (latest)

outer lichen
#

how would I go about creating an items system? (hotbar, inventory, grabbing, stacks, equipping)

gleaming glen
#

first u should detect when spefific buttons are pressed like 1,2,3,4,5,6,7,8,9 and ` or backtick for opening backpack

#

then create a variable called selected that holds the value of which item is selected

#

it should look like this kinda

#
local selected = nil
    
UIS.InputBegan:Connect(function(input, gpe)
if gpe then return end


if input.KeyCode == Enum.KeyCode.One then
if selected == 1 then
    itemUneqipped(1)
    selected = nil
else
    itemEquipped(1)
    selected = 1
end        
#

the point of making this selected value is so that when the function detects the same selected value again, we know the player pressed the same number twice and wants to de equip it

#

besides that you just change and update the UI accordingly

#

make sure u say ```game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

#

so the actual rblx gui appears

rich hullBOT
#

studio** You are now Level 2! **studio

maiden shell
#

im a scripter and i need tutorials to have a general idea

#

i want to make a game

gleaming glen
#

I didnt even know how to do this before I searched it up

#

just go try to make what ever u want and eventually u will learn small things