EDIT 2
01 | game.Players.ChildAdded:connect( function (newPlayer) |
02 | newPlayer.Character.Humanoid.WalkSpeed = 0 |
03 | newPlayer.Character.Humanoid.MaxHealth = math.huge |
04 | newPlayer.Character.Humanoid.Health = 9 e 9 |
05 | script.Parent.TextTransparency = 0.9 |
06 | wait( 0.1 ) |
07 | script.Parent.TextTransparency = 0.8 |
08 | wait( 0.1 ) |
09 | script.Parent.TextTransparency = 0.7 |
10 | wait( 0.1 ) |
11 | script.Parent.TextTransparency = 0.6 |
12 | wait( 0.1 ) |
13 | script.Parent.TextTransparency = 0.5 |
14 | wait( 0.1 ) |
15 | script.Parent.TextTransparency = 0.4 |
Please tell me why this won't work.
PlayerAdded doesn't fire for LocalScripts. You'll have to use game.Players.ChildAdded instead.
Assuming this is a server side script, you can only call game.Players.LocalPlayer from a LocalScript (hence local Player). Instead, you would want
1 | game.Players.ChildAdded:connect( function (newPlayer) |
2 | newPlayer.Character.Humanoid.WalkSpeed = 0 |
3 | newPlayer.Character.Humanoid.MaxHealth = math.huge |
4 | newPlayer.Character.Humanoid.Health = 9 e 9 |
However, if you've got a LocalScript here and it's in something like StarterGui, a copy of this script will be given to each player that joins the game. So you know that this player has joined the game when the script starts running. You can just forget the connections and jump straight into business.
Also, I really suggest that you look into for loops! All that transparency code works, but it can really be condensed.