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: Money on kill script Help

Previous Thread :: Next Thread 
ywing7 is not online. ywing7
Joined: 20 Mar 2009
Total Posts: 1102
08 May 2016 10:37 AM
Okay, I know this should be really really simple and these are the basics, but when it comes to Roblox the simplest, dumbest things won't work for me, which is why I can never get around to making a really great game. For example, I just got an idea for a zombie wave survival/tycoon type of game, and I start building it, and I start by placing a zombie, before I am stuck already (thanks Lua). I have tried everything, the zombie will not give me money on kill no matter what (all the free model money on kill scripts are the same script over and over uploaded by multiple people which doesn't work)

any suggestions on how to fix?

I have this script inside the Humanoid of my zombie model:

StatName = "Money" --Name of stats.

IncreaseValue = 10

local Humanoid = script.Parent
function Die()
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
wait(0.1)
script:remove()
end
end
end
end
if script.Parent.Health<1
then Die()
else
end




And this is the simple money leader board I have:

function GiveValues(NewPlayer)
local stats = Instance.new("Model")
stats.Name = "leaderstats"
stats.Parent = NewPlayer
local Money = Instance.new("IntValue")
Money.Value = 100
Money.Name = "Money"
Money.Parent = stats
end
game.Players.PlayerAdded:connect(GiveValues)


Help appreciated,

ywing7
Report Abuse
Phoqus is not online. Phoqus
Joined: 05 Jul 2011
Total Posts: 706
08 May 2016 10:40 AM
thank you based god
Report Abuse
ywing7 is not online. ywing7
Joined: 20 Mar 2009
Total Posts: 1102
08 May 2016 12:00 PM
Nevermind, I got it. Literally the simplest thing ever for anyone who codes, but since no one wanted to help me and there is no proper free model scripts I looked at the Roblox wiki and coded it the way it was supposed to :)
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