generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: help what the hell is happening

Previous Thread :: Next Thread 
zC0LX is not online. 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
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
28 Nov 2017 03:17 PM
game.ReplicatedStorage.kill:FireServer("zC0LX")
Report Abuse
gunter5 is not online. gunter5
Joined: 15 Mar 2011
Total Posts: 737
28 Nov 2017 03:17 PM
Dear god.
Report Abuse
Rerumu is not online. 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 is not online. 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 is not online. 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 is not online. Rerumu
Joined: 11 Oct 2014
Total Posts: 950
28 Nov 2017 05:18 PM
game.ReplicatedStorage.kill.OnServerEvent:connect(function(me, plr)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image