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 » Scripting Helpers
Home Search
 

Re: Kills IntValue

Previous Thread :: Next Thread 
TheRobloxian909 is not online. TheRobloxian909
Joined: 08 Aug 2013
Total Posts: 2444
23 Feb 2014 12:01 PM
Not working, tried in online mode using dummies (script in a bullet and bullet is in a tool)

script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid")~=nil then
if hit.Parent.Humanoid.Health == 0 then
n = script.Parent.Parent.Name
p=game.Players:findFirstChild(n)
n.leaderstats.Kills.Value = n.leaderstats.Kills.Value + 1
end
end
end
Report Abuse
StackEnd is not online. StackEnd
Joined: 20 Oct 2008
Total Posts: 672
23 Feb 2014 12:13 PM
Change "n = script.Parent.Parent.Name " to "n = hit.Parent.Parent.Name"
Report Abuse
StackEnd is not online. StackEnd
Joined: 20 Oct 2008
Total Posts: 672
23 Feb 2014 12:14 PM
If the script's in a bullet and the bullet's in a tool, script.Parent.Parent.Name is the name of the tool.
Report Abuse
TheRobloxian909 is not online. TheRobloxian909
Joined: 08 Aug 2013
Total Posts: 2444
23 Feb 2014 12:26 PM
Oh, I wanted to get the character, but it doesn't still work
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
23 Feb 2014 12:30 PM
n.leaderstats.Kills.Value = n.leaderstats.Kills.Value + 1

n is just the name. It should be p, not n.
Report Abuse
MarioKartAddict is not online. MarioKartAddict
Joined: 11 Nov 2009
Total Posts: 42774
23 Feb 2014 12:30 PM
n = hit.Parent.Name
Report Abuse
TheRobloxian909 is not online. TheRobloxian909
Joined: 08 Aug 2013
Total Posts: 2444
23 Feb 2014 12:33 PM
TheGamer101, thanks. It works now.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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