|
| 09 Mar 2015 06:26 PM |
function Dead() local tag = script.Parent.Zombie:FindFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local leaderstats = tag.Value:FindFirstChild("leaderstats") if leaderstats ~= nil then if tag.Value:IsInGroup(72321) then leaderstats.Dollars.Value = leaderstats.Dollars.Value + 20 else leaderstats.Dollars.Value = leaderstats.Dollars.Value + 10 end end end end wait(5) script.Parent:remove() end
script.Parent.Zombie.Died:connect(Dead)
The funcion of this script is when a player kills an NPC, when the player is in FEAR, he wins 20 dollars, but if a player is not a member of the group, he wins 10. I don't know how to fix it, no error displayed on the output and don't change Zombie to Humanoid please (I don't want to players kill each other). |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 08:16 PM |
| I will make a good game if you men help me. |
|
|
| Report Abuse |
|
|
gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 09 Mar 2015 08:42 PM |
Change local leaderstats = tag.Value:FindFirstChild("leaderstats")
to
local leaderstats = game.Players[tag.Value]:FindFirstChild("leaderstats")
Why don't you take a seat over there? |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2015 08:45 PM |
| Gerov, I don't see any chair. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Mar 2015 06:04 AM |
this is your problem,
local leaderstats = tag.Value:FindFirstChild("leaderstats") if leaderstats ~= nil then if tag.Value:IsInGroup(72321) then
this is your solution.
local leaderstats = game.Players[tag.Value]:FindFirstChild("leaderstats") if leaderstats ~= nil then if leaderstats.Parent:IsInGroup(72321) then |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2015 06:27 AM |
| I will put it later, first is that I reput my zombie and fixed it's following script, but it is above me! |
|
|
| Report Abuse |
|
|
BossHat
|
  |
| Joined: 09 Jun 2014 |
| Total Posts: 3713 |
|
| |
|