SammaeI
|
  |
| Joined: 07 Mar 2014 |
| Total Posts: 144 |
|
|
| 07 Feb 2017 09:19 PM |
Making an Administrator script. Long-question short, after I execute the following script, it returns in error.
local Administrators = {'CI_Systems', 'SammaeI', 'Player1'}
game.Players.PlayerAdded:connect(function(player) for _, v in pairs(Administrators) do if player.Name == v then print("Administrator has entered.") local clone = game.ServerStorage.LocalScript:Clone() clone.Parent = player.PlayerScripts print("Tested") end end end) -- Note: LocalScript contains nothing; just a simple 'print("Hello World!"'
Goal is to insert a script in PlayerScripts within the Administrator player. I keep getting this error:
- ServerScriptService.Script:19: attempt to index local 'player' (a nil value)
idk. Help would be indeed nice. |
|
|
| Report Abuse |
|
|
SammaeI
|
  |
| Joined: 07 Mar 2014 |
| Total Posts: 144 |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 07 Feb 2017 09:33 PM |
You need to give more info.
The error message you posted says the error is on line 19. There are not 19 lines in the code you posted. |
|
|
| Report Abuse |
|
|
SammaeI
|
  |
| Joined: 07 Mar 2014 |
| Total Posts: 144 |
|
|
| 07 Feb 2017 09:34 PM |
extra lines were just white spaces (non-used pieces of lines)
|
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 07 Feb 2017 09:35 PM |
| Where is the error at? You can't fix a problem without know what the problem is. |
|
|
| Report Abuse |
|
|
SammaeI
|
  |
| Joined: 07 Mar 2014 |
| Total Posts: 144 |
|
|
| 07 Feb 2017 09:44 PM |
local clone = game.ServerStorage.LocalScript:Clone() clone.Parent = player.PlayerScripts |
|
|
| Report Abuse |
|
|