#Inventory system
1 messages · Page 1 of 1 (latest)
You script it
The basics of an inventory system is just tables. You want to store objects you retrieve via a table
i made an inventory system without any tutorials and i just make a folder inside the player and have a script just fill the folder with an intvalue with the name as the item and the value as the amount of that item
anyways
do something like
local button1 = pathtobutton1
local button2 = path to button2
local button1Clicked = false
local button2Clicked = false
button1.mousebutton1click:connect(function(plr)
button1Clicked = true
if button2Clicked then
--animation to undo button 2 click
button2Clicked = false
end
--rest of the code whatever it does etc...
end)
button2.mousebutton1click:connect(function(plr)
button2Clicked = true
if button1Clicked then
--animation to undo button 1 click
button1Clicked = false
end
--rest of the code whatever it does etc...
end)
i wrote this randomly without rblox studio you will have to fix errors like capital letters etc and change to what you're actually doing such as if you want it to be like oh mouse hover over button change it urself
--edit probably use a coroutine or a task.spawn so you can do both animations at the same time
button1.mousebutton1click:connect(function(plr)
button1Clicked = true
if button2Clicked then
task.spawn(function()
--animation to undo button 2 click
end)
button2Clicked = false
end
--animation for button 1
--rest of the code whatever it does etc...
end)
You could do that ig but there are a tons of flaws to that method
yeah i realised that - i been scripting for like 4 or 5 months i thought of it as a challenge because tutorials dont help you learn - anyways when i actually save it as datastore i have to do plr.owneditems:getchildren() to get the table and then fire an event to get the table outside of the scope
it was stupid way of doing it but yeah it worked
@swift fulcrum hold on id actually like to know more talk in #📜︱scripting