|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 23 Feb 2014 12:26 PM |
| Oh, I wanted to get the character, but it doesn't still work |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 23 Feb 2014 12:33 PM |
| TheGamer101, thanks. It works now. |
|
|
| Report Abuse |
|
|