local touch = false function OnTouch() wait(0.3) touch = true end script.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.
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