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 4 years ago
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.

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 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