I'm making a food simulator and i made a pizza. every time you activate tool it adds +1 to int value, how to make the tool destroy after the int value value reaches 3?? I really need your help guys
✓ ANSWER ACCEPTED
How to make tool destroy when value reaches specific number?
1 answer
✓ Accepted answer
Tool = script.Parent -- Tool TimesActivated = 0 -- The value. Tool.Activated:Connect(function() -- Fires whenever the tool is activated. if TimesActivated > 2 then --Checks if it is over the value of 2! Tool:Destroy() -- Removes the tool. else TimesActivated=TimesActivated+1 -- Increases the value. end end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
put it in a lua script box so he can understand better.