Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make a value change when i step off a part?

Asked by 5 years ago
1local touch = false
2 
3function OnTouch()
4    wait(0.3)
5    touch = true
6 
7end
8 
9script.Parent.Touched:Connect(OnTouch)

Hi, i have a part and when i touch it changes a local value 'touch' to true but i wanna add another function where when i step off the part it changes the value 'touch' to false but i have no idea how to do that. i'm really new to coding sry.

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Always try to search for answers before asking here, a similar thread can be found here: https://scriptinghelpers.org/questions/93663/how-to-make-cash-giver-button-keep-giving-cash-until-the-player-stops-touching

Ad

Answer this question