zC0LX
|
  |
| Joined: 02 Apr 2017 |
| Total Posts: 59 |
|
|
| 28 Nov 2017 03:15 PM |
i haz a remote-event called 'kill' in ReplicatedStorage and here is the script that assigned it something:
game.ReplicatedStorage.kill.OnServerEvent:connect(function(plr) game.Players:FindFirstChild(plr).Character.Health = 0 end and then i did game.ReplicatedStorage.kill:FireServer(zC0LX) and it did nothing and it said "attempt to index a nil value" halp pls
#code print('oh no an error!!') |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2017 03:17 PM |
game.ReplicatedStorage.kill:FireServer("zC0LX")
|
|
|
| Report Abuse |
|
|
gunter5
|
  |
| Joined: 15 Mar 2011 |
| Total Posts: 737 |
|
| |
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 28 Nov 2017 03:22 PM |
This is very bad practice, just a heads up. You're giving the client too much power in this situation. Moreover, you're using FindFirstChild wrong, as it'd error anyways if it wasn't there.
Either use FindFirstChild to check for nil or just do game.Players[plr] instead. |
|
|
| Report Abuse |
|
|
zC0LX
|
  |
| Joined: 02 Apr 2017 |
| Total Posts: 59 |
|
|
| 28 Nov 2017 03:23 PM |
attempt to index a nil value still
#code print('oh no an error!!') |
|
|
| Report Abuse |
|
|
zC0LX
|
  |
| Joined: 02 Apr 2017 |
| Total Posts: 59 |
|
|
| 28 Nov 2017 03:24 PM |
and reremu it says this now bad argument #2 to '?' (string expected, got Object)
#code print('oh no an error!!') |
|
|
| Report Abuse |
|
|
Rerumu
|
  |
| Joined: 11 Oct 2014 |
| Total Posts: 950 |
|
|
| 28 Nov 2017 05:18 PM |
| game.ReplicatedStorage.kill.OnServerEvent:connect(function(me, plr) |
|
|
| Report Abuse |
|
|