#Inventory system

1 messages · Page 1 of 1 (latest)

versed folio
#

how do u make an inventory system where u can like make an animation if you are holding something, im making it so that when you press it the size changes. how do i make it so that when i click another one, the other one reverts back to normal

fickle charm
#

You script it

swift fulcrum
marble onyx
#

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)
swift fulcrum
#

You could do that ig but there are a tons of flaws to that method

marble onyx
#

it was stupid way of doing it but yeah it worked

swift fulcrum
#

It's not a stupid way to make it

#

I just said that method has some flaws to it

marble onyx