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

Making a loop with the swimming event?

How do I make a loop with the swimming event, for example it checks to see if you are still swimming every second? Can anyone provide me with a template?

1 answer

✓ Accepted answer

Here is example code of connecting the Swimming event to every new player, and each time they spawn. Using the now-standard anonymous functions.

Game.Players.PlayerAdded:connect(function(p)
	p.CharacterAdded:connect(function(c)
		c:WaitForChild("Humanoid").Swimming:connect(function()
		
		end)
	end)
end)

1 comment

0

Gotta love anonymous functions

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