Difference between revisions of "PlayerAdded (Event)"

From Goodblox Wiki
Jump to navigationJump to search
m
m
 
Line 1: Line 1:
 
{{CatUp|Events}}
 
{{CatUp|Events}}
 
 
<onlyinclude>{{Event|name=PlayerAdded
 
<onlyinclude>{{Event|name=PlayerAdded
 
|arguments=[[Instance]] ''Player''
 
|arguments=[[Instance]] ''Player''
Line 6: Line 5:
 
|object= [[RBX.lua.Players (Service)|Players]]
 
|object= [[RBX.lua.Players (Service)|Players]]
 
|}}</onlyinclude>
 
|}}</onlyinclude>
 +
 
Example:
 
Example:
 
<pre>
 
<pre>
function onPlayerEntered(newPlayer)
+
local function onPlayerEntered(newPlayer)
wait(10)
+
    wait(10)
newPlayer.Character.Torso.Transparency = 1
+
    newPlayer.Character.Torso.Transparency = 1
 
end
 
end
  

Latest revision as of 22:05, 23 September 2021

Event
Syntax PlayerAdded( Instance Player )
Description: Fired after a player enters the game.
In Object: Players


Example:

local function onPlayerEntered(newPlayer)
     wait(10)
     newPlayer.Character.Torso.Transparency = 1
end

game.Players.PlayerAdded:connect(onPlayerEntered)