maxter480
|
  |
| Joined: 17 Jan 2008 |
| Total Posts: 102 |
|
|
| 19 Sep 2011 05:36 PM |
DO NOT RESPOND IF YOU ARENT GOING TO HELP. THIS IS A COMMONLY USED FUCTION IN A LOT OF GAMES BUT I NEED HELP. IT DOESNT SAY ANYTHING ON THE WIKI THAT HELPS.
So I have a script in my zombie with a Humanoid called Humanoid, but when I kill it, the leaderstats don't increase
The script that is in the zombie is:
Stat2 = True --Make this either true or false depending if you want something else to go be increased in leaderstats.
StatName = "Points" --Name of stats.
IncreaseValue = 100
Stat2Name = "Kills" --SecondStat name
IncreaseValue2 = 1
local Humanoid = script.Parent.Humanoid function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats[StatName].Value = Leaderstats[StatName].Value + IncreaseValue if Stat2 == true then Leaderstats[Stat2Name].Value = Leaderstats[Stat2Name].Value + IncreaseValue2 wait(0.1) script:remove() end end end end end Humanoid.Died:connect(PwntX_X) |
|
|
| Report Abuse |
|
|
italius
|
  |
| Joined: 14 Sep 2011 |
| Total Posts: 3560 |
|
|
| 19 Sep 2011 05:37 PM |
DO NOT RESPOND IF YOU ARENT GOING TO HELP. THIS IS A COMMONLY USED FUCTION IN A LOT OF GAMES BUT I NEED HELP. IT DOESNT SAY ANYTHING ON THE WIKI THAT HELPS.
So I have a script in my zombie with a Humanoid called Humanoid, but when I kill it, the leaderstats don't increase
The script that is in the zombie is:
Stat2 = True --Make this either true or false depending if you want something else to go be increased in leaderstats.
StatName = "Points" --Name of stats.
IncreaseValue = 100
Stat2Name = "Kills" --SecondStat name
IncreaseValue2 = 1
local Humanoid = script.Parent.Humanoid function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats[StatName].Value = Leaderstats[StatName].Value + IncreaseValue if Stat2 == true then Leaderstats[Stat2Name].Value = Leaderstats[Stat2Name].Value + IncreaseValue2 wait(0.1) script:remove() end end end end end Humanoid.Died:connect(PwntX_X) end
Please buy this, I have 62 robux.. http://www.roblox.com/Donation-shirt-item?id=61817801 |
|
|
| Report Abuse |
|
|
|
| 19 Sep 2011 05:39 PM |
| 'True' is not capitalized in Lua. If the script STILL doesn't work after you change the case of True, your WEAPON does not put a creator tag in the humanoid when it damages your zombie. |
|
|
| Report Abuse |
|
|
maxter480
|
  |
| Joined: 17 Jan 2008 |
| Total Posts: 102 |
|
|
| 19 Sep 2011 07:19 PM |
Thanks fire. My gun doesn't make the creatortag. Does that go in the projectile script or the reg. gun script? and what is the script to make a creator tag?
|
|
|
| Report Abuse |
|
|
maxter480
|
  |
| Joined: 17 Jan 2008 |
| Total Posts: 102 |
|
|
| 19 Sep 2011 07:22 PM |
| Nevermind, I found it on my own. Thanks a ton |
|
|
| Report Abuse |
|
|