Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make tool destroy when value reaches specific number?

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

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)

1 comment

0

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

This discussion is preserved as it was. New answers, comments, and votes are closed.