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

Repeat until StoppedTouching?

How exactly would I do this instead of using StoppedTouching:Connect()? cos am not making another function, cos I wanna do stuff until the person stops Touching...

1 answer

✓ Accepted answer
part.Touched:connect(function(hit)
touch = true
repeat --whatever 
until not touch
end)
part.TouchEnded:connect(function() touch = false end)

2 comments

0

lol the last line confuses me a lil

0

Well the loop will continue to run until the part.TouchEnded makes touch = false

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