Climbing (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
Very small fixes
>Camoy
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{|
<onlyinclude>{{Event
|<onlyinclude>{{Event|name = Climbing
|name = Climbing
|arguments = [[Float]] ''speed''
|arguments = [[Float]] ''speed''
|description = Fired when a character climbs.
|description = Fired when a character climbs.
|object = [[Humanoid]]
|object = Humanoid
|}}</onlyinclude>
}}</onlyinclude>
|}
 
{{clear floats}}


== Description ==
== 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 [[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 usually around 11 studs/second.
The argument, ''speed'', describes how quickly the player is climbing. The value of ''speed'' is 70% of the Humanoid's [[WalkSpeed]].
{{Example|<pre>
{{Example|<pre>
local function onCharacterClimbing(character, speed)
local function onCharacterClimbing(character, speed)
Line 26: Line 27:
game.Players.PlayerAdded:connect(onPlayerAdded)
game.Players.PlayerAdded:connect(onPlayerAdded)
</pre>}}
</pre>}}
[[Category:Events]]

Latest revision as of 15:41, 29 January 2011

Climbing ( Float speed )
Description Fired when a character climbs.
Member of: Humanoid


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)