|
| 18 Feb 2016 02:19 AM |
So for some reason doing
game.Players.PlayerAdded:connect(function() --code end)
Does absolutely nothing. So why does the PlayerAdded event never fire? |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:19 AM |
Where is your script located?
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:21 AM |
| Originally I tried it as a localscript in ScreenGui (as part of a frame), then tried it as a script in ServerScriptService. Same result. |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:22 AM |
So you tried a local script in ServerScriptService?
Local scripts only work client sided. Use a normal script. I advise you don't use playeradded via client side as it will never record the client itself being added.
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:23 AM |
| I used a server script in ServerScriptService (you can't use LocalScripts in SSS) |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:25 AM |
Delete your current script and put this: A normal script in ServerScriptService:
game.Players.PlayerAdded:connect(function(player) print(player.Name) end)
This will work ;)
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:25 AM |
| The only thing I can think of is that Disabled = true |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:27 AM |
@ninetailfox Nope
Here is what my code does:
game.Players.PlayerAdded:connect(function() local userData = Instance.new("NumberValue") userData.Parent = game.ReplicatedStorage.userData userData.Name = tostring(game.Players.LocalPlayer) if game.Players.LocalPlayer.TeamColor.Name == "Really red" then userData.Value = 0 elseif game.Players.LocalPlayer.TeamColor.Name == "Really blue" or game.Players.LocalPlayer.TeamColor.Name == "Lapis" then userData.Value = 1 end end) |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:29 AM |
| firstly you can't use game.Players.LocalPlayer on a server side script, do what Advanced said, and use "player.TeamColor" |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2016 02:29 AM |
| Okay nevermind it now works. After a whole lot of waiting. |
|
|
| Report Abuse |
|
|