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

How do I make a thing that if you touched, the Value will change?

Please answer this. I have no idea to do this.

1 answer

✓ Accepted answer

Bruh, please, I think you can try it yourself. You're warned.

Uh, anyway, this is the script though.

Before this, make a NumberValue in the game, and parent the Value to a part, and insert a script into the part that you inserted that NumberValue.

debounce = false -- we use debounce to prevents spams

while wait(.5) do -- update the script every 0.5 seconds
script.Parent.Touched:Connect(function(plr) -- if people touched
	debounce = true
	script.Parent.Value.Value = 1 -- make the value become 1
	debounce = false
end)

script.Parent.TouchEnded:Connect(function(plr) -- if people touch ended then
	debounce = true
	script.Parent.Value.Value = 0 -- make the value become 0.
	debounce = false
end)
end

Anyways, here's the script, so if you have more questions, PM me, or question below! I'll be glad to help. But please don't ask for the script again, try it yourself first, thanks!

1 comment

0

Thanks xD

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