PlayerRemoving (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>MrNicNac
No edit summary
>JulienDethurens
No edit summary
Line 1: Line 1:
<onlyinclude>{{Event|name = PlayerRemoving
<onlyinclude>{{Event|name = PlayerRemoving
|arguments = [[Player]] ''player''
|arguments = [[Player]] <var>player</var>
|description = Fires before a player is disconnected from a game.
|description = Fires when a player is leaving the game.
|object = Players
|object = Players
}}</onlyinclude>
}}</onlyinclude>
Line 7: Line 7:
{{clear floats}}
{{clear floats}}


{{Example|<pre>
{{Example|<code lua>
local function onPlayerLeaving(Player)
local function onPlayerLeaving(Player)
   print(Player.Name.." is leaving the game!")
   print(Player.Name.." is leaving the game!")
Line 13: Line 13:


game.Players.PlayerRemoving:connect(onPlayerLeaving)
game.Players.PlayerRemoving:connect(onPlayerLeaving)
</pre>}}
</code>}}
 
*[[File:Event Icon.png]][[PlayerAdded_(Event)|PlayerAdded]]


[[Category:Events]]
[[Category:Events]]

Revision as of 08:30, 28 January 2012

PlayerRemoving ( Player player )
Description Fires when a player is leaving the game.
Member of: Players


Example

local function onPlayerLeaving(Player)

 print(Player.Name.." is leaving the game!")

end

game.Players.PlayerRemoving:connect(onPlayerLeaving)