How do you cause the part to do something the first time it's touched, but when you touch it again it does something else, then it does the first action again, and so on in only one script? Thanks!
local debounce = false
function onTouched()
if not debounce then
debounce = true
--code
function onTouched() -- lol I tried this to see if it works, but it didn't
--code
end
debounce = false
end
end
script.Parent.Touched:connect(onTouched)

3 comments
Do you want it to repeat that next action every time after the first action?
I want it to do the first action, then when it is touched again, it does the second action, and then repeats. So it goes back to action 1.
You could put it in a while loop and wait on the event to occur. In order to get information from events, set variables on the event such as PartThatHit = Part.Touched:wait() Try: while wait() script.Parent.Touched:wait() --Code Here script.Parent.Touched:wait() --Second Code Here end