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: Can Anyone Help -Simple Scripting Help-

Previous Thread :: Next Thread 
lolswagXDXD is not online. lolswagXDXD
Joined: 08 Aug 2015
Total Posts: 48
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 is not online. 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
chrislojet5533 is not online. chrislojet5533
Joined: 15 Jun 2015
Total Posts: 2419
10 Dec 2016 05:25 PM
u need to do .value at the points


no
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