PlayerRemoving (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
Format/example
>Camoy
It is AFTER, a mistake started by Anaminus
Line 1: Line 1:
{|
{|
|<onlyinclude>{{Event|name = PlayerRemoving
|<onlyinclude>{{Event|name = PlayerRemoving
|arguments = [[Instance]] ''player''
|arguments = [[Player]] ''player''
|description = Fired after a player leaves the game.
|description = Fired right before the player leaves the game.
|object = [[Players]]
|object = [[Players]]
|}}</onlyinclude>
|}}</onlyinclude>
|}
|}
{{Example|
{{Example|<pre>
<pre>
local function onPlayerLeaving(Player)
local function onPlayerLeaving(Player)
   print(Player.Name.." has left the game!")
   print(Player.Name.." is leaving the game!")
end
end


game.Players.PlayerRemoving:connect(onPlayerLeaving)
game.Players.PlayerRemoving:connect(onPlayerLeaving)
</pre>}}
</pre>}}

Revision as of 18:06, 29 August 2010

PlayerRemoving ( Player player )
Description Fired right before the player leaves the game.
Member of: [[RBX.lua.Players (Object)|Players]]
Example
local function onPlayerLeaving(Player)
  print(Player.Name.." is leaving the game!")
end

game.Players.PlayerRemoving:connect(onPlayerLeaving)