Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Making a loop with the swimming event?

Asked by 10 years ago

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

Log in to vote
1
Answered by
MrNicNac 855 Moderation Voter
10 years ago

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)
0
Gotta love anonymous functions trogyssy 221 — 10y
Ad

Answer this question