|
| 10 Dec 2016 05:20 PM |
I'm trying to create a script were if the player kills the noob the points changes by 1, I have the points system working i just need help on this script:
if game.workspace.Folder.noobs.noob.Humanoid.Health == 0 game.Players.LocalPlayer.leaderstats.Points == game.Players.LocalPlayer.leaderstats.Points + 1 end
--Yes i know i am a noob and scripting and i'm doing something terribly wrong-- |
|
|
| Report Abuse |
|
Badandy11
|
  |
| Joined: 02 Jul 2009 |
| Total Posts: 1861 |
|
|
| 10 Dec 2016 05:24 PM |
I see this is a local script, and if this isn't a local script than "LocalPlayer" won't work. Here's a rule I go by, never let local scripts change data or decide what changes, the server script should always have control. Also if you don't have FE on, it's recommended so there's at least some protection.
What you are doing here is simple,
When the script loads it runs the if statement and it only runs it once. So if the health is 100 when the script loads, it ends the script.
What I recommend is using the Humanoid Died event: http://wiki.roblox.com/index.php?title=API:Class/Humanoid/Died
So when the humanoid dies, it triggers the block of code you connect with the event. So you don't need a constant while loop always checking the health. |
|
|
| Report Abuse |
|
|
| 10 Dec 2016 05:25 PM |
u need to do .value at the points
no |
|
|
| Report Abuse |
|