I'm making a script that uses a repeat until loop that initially triggers when its touched by a player.. The issue is, it always starts over every time the player moves around. Is there a way to make a script that runs as long as a player is touching a part?
Here is my attempt:
script.Parent.Touched:Connect(function(hit)
repeat
script.Parent.BrickColor = BrickColor.new("Institutional white")
wait(1)
script.Parent.BrickColor = BrickColor.new("Really black")
wait(1)
until script.Parent.TouchEnded
end)

5 comments
will you show your script, or not?
I don't have proper script yet. Right now I'm just making a part switch between black and white every second.
dont request on this site then
I want to know if there is a way to do it. I'll post a script then.
Happy?