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
|
  |
| Joined: 05 Jul 2011 |
| Total Posts: 706 |
|
| |
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 |
|