PlayerAdded (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Blocco
Replaced example with example template.
>Camoy
Small fixes
Line 1: Line 1:
{|
{|
|<onlyinclude>{{Event|name=PlayerAdded
|<onlyinclude>{{Event|name = PlayerAdded
|arguments=[[Instance]] ''Player''
|arguments = [[Instance]] ''player''
|description= Fired after a player enters the game.
|description = Fired after a player enters the game.
|object= [[RBX.lua.Players (Service)|Players]]
|object = [[Players]]
|}}</onlyinclude>
|}}</onlyinclude>
|}
|}


{{Example|
{{Example|
<pre>function onPlayerEntered(newPlayer)
<pre>local function onPlayerEntered(newPlayer)
wait(10)
wait(10)
newPlayer.Character.Torso.Transparency = 1
newPlayer.Character.Torso.Transparency = 1
end
end


game.Players.PlayerAdded:connect(onPlayerEntered)</pre>}}
game.Players.PlayerAdded:connect(onPlayerEntered)
</pre>}}

Revision as of 15:07, 29 August 2010

PlayerAdded ( Instance player )
Description Fired after a player enters the game.
Member of: [[RBX.lua.Players (Object)|Players]]
Example
local function onPlayerEntered(newPlayer)
wait(10)
newPlayer.Character.Torso.Transparency = 1
end

game.Players.PlayerAdded:connect(onPlayerEntered)