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: No reward when a player kills a zombie.

Previous Thread :: Next Thread 
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
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
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
09 Mar 2015 08:16 PM
I will make a good game if you men help me.
Report Abuse
gerov is not online. 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
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
09 Mar 2015 08:45 PM
Gerov, I don't see any chair.
Report Abuse
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
09 Mar 2015 08:48 PM
Nope, it didn't worked.
Report Abuse
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
10 Mar 2015 05:42 AM
Anyone else can help me?
Report Abuse
FunkiAndrew is not online. FunkiAndrew
Joined: 01 Dec 2013
Total Posts: 2318
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
StickMasterNinja2 is not online. StickMasterNinja2
Joined: 18 May 2013
Total Posts: 1170
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 is not online. BossHat
Joined: 09 Jun 2014
Total Posts: 3713
10 Mar 2015 06:29 AM
humanoid
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