Climbing (Event): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy Very small fixes |
>Anaminus trivia |
||
Line 10: | Line 10: | ||
The Climbing event of Humanoid gets triggered whenever a character is climbing up bricks. This can be fired when a character climbs up either a [[Truss]] or a stack of [[Part|parts]]. | The Climbing event of Humanoid gets triggered whenever a character is climbing up bricks. This can be fired when a character climbs up either a [[Truss]] or a stack of [[Part|parts]]. | ||
The argument, speed, describes how quickly the player is climbing. The value of speed is | The argument, ''speed'', describes how quickly the player is climbing. The value of ''speed'' is 70% of the Humanoid's [[WalkSpeed_(Property)|WalkSpeed]]. | ||
{{Example|<pre> | {{Example|<pre> | ||
local function onCharacterClimbing(character, speed) | local function onCharacterClimbing(character, speed) | ||
Line 25: | Line 25: | ||
game.Players.PlayerAdded:connect(onPlayerAdded) | game.Players.PlayerAdded:connect(onPlayerAdded) | ||
</pre>}} | </pre>}} |
Revision as of 16:45, 1 October 2010
Description
The Climbing event of Humanoid gets triggered whenever a character is climbing up bricks. This can be fired when a character climbs up either a Truss or a stack of parts.
The argument, speed, describes how quickly the player is climbing. The value of speed is 70% of the Humanoid's WalkSpeed.
Example
local function onCharacterClimbing(character, speed) print(character.Name, "is climbing at a speed of", speed, "studs / second.") end local function onCharacterAdded(character) character.Humanoid.Climbing:connect(function(speed) onCharacterClimbing(character, speed) end) end local function onPlayerAdded(player) player.CharacterAdded:connect(onCharacterAdded) end game.Players.PlayerAdded:connect(onPlayerAdded)