CharacterAdded (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>GoldenUrg
initial - from experience
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
 
(31 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<onlyinclude>
<onlyinclude>{{Event|name = CharacterAdded
{{Event|
|arguments = [[Instance]] <var>character</var>
name = CharacterAdded
|arguments = [[Instance]] ''character''
|description = Fired when a character spawns or respawns.
|description = Fired when a character spawns or respawns.
|object = [[RBX.lua.Player (Object)|Player]]
|object = Player
|}}
|}}</onlyinclude>
</onlyinclude>


The ''character'' will be a model with Humanoid, all body parts, scripts, and joints. The model will be completely loaded when triggered by game.
{{clear floats}}
 
== Description ==
<var>character</var> will be a [[Model]] with [[Humanoid]], all body parts, scripts, and joints. The model will be completely loaded when triggered by game.
 
{{Example|
This code will make set every player's [[WalkSpeed]] to 25 everytime they respawn:
<syntaxhighlight lang="lua">
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character.Humanoid.WalkSpeed = 25
end)
end)
</syntaxhighlight>}}
 
[[Category:Events]]

Latest revision as of 06:16, 27 April 2023

CharacterAdded ( Instance character )
Description Fired when a character spawns or respawns.
Member of: Player


Description

character will be a Model with Humanoid, all body parts, scripts, and joints. The model will be completely loaded when triggered by game.

Example

This code will make set every player's WalkSpeed to 25 everytime they respawn:

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character.Humanoid.WalkSpeed = 25
	end)
end)