Stroniax
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 138 |
|
|
| 07 Aug 2012 01:02 AM |
How can I make a LeaderStat that gives you a KO and 5 $ every time you kill somebody and gives you 1 $ every minute? If this is possible please help!
~I spread like a plague, for that is what I am~ |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 01:06 AM |
i would start by taking a look at linkedleaderboard and linkedsword
the mechanism used to find the killer is quite unique |
|
|
| Report Abuse |
|
|
chris1989
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 2520 |
|
|
| 07 Aug 2012 01:10 AM |
game.Players.PlayerAdded:connect(function(p) local lead = Instance.new("IntValue") lead.Name = "leaderstats" local ko = Instance.new("IntValue") ko.Name = "KO" ko.Parent = lead local money = Instance.new("IntValue") money.Name = "Money" money.Parent = lead lead.Parent = p p.CharacterAdded:connect(function(c) repeat wait() h = c:FindFirstChild("Humanoid") until h ~= nil h.Died:connect(function() local Killer = h:findFirstChild("creator") if Killer ~= nil then local lead = Killer:findFirstChild("leaderstats") if lead ~= nil then local ko = lead:findFirstChild("KO") local money = lead:findFirstChild("Money") if ko ~= nil and money ~= nil then ko.Value = ko.Value + 1 money.Value = money.Value + 5 end end end end) end) end) |
|
|
| Report Abuse |
|
|
chris1989
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 2520 |
|
|
| 07 Aug 2012 01:10 AM |
game.Players.PlayerAdded:connect(function(p) local lead = Instance.new("IntValue") lead.Name = "leaderstats" local ko = Instance.new("IntValue") ko.Name = "KO" ko.Parent = lead local money = Instance.new("IntValue") money.Name = "Money" money.Parent = lead lead.Parent = p p.CharacterAdded:connect(function(c) repeat wait() h = c:FindFirstChild("Humanoid") until h ~= nil h.Died:connect(function() local Killer = h:findFirstChild("creator") if Killer ~= nil then local lead = Killer.Value:findFirstChild("leaderstats") if lead ~= nil then local ko = lead:findFirstChild("KO") local money = lead:findFirstChild("Money") if ko ~= nil and money ~= nil then ko.Value = ko.Value + 1 money.Value = money.Value + 5 end end end end) end) end) |
|
|
| Report Abuse |
|
|
Stroniax
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 138 |
|
|
| 07 Aug 2012 01:13 AM |
I would like the script not just "look at this" because in my experience they never work. PS I looked at the LinkedLeaderBoard earlier today.
~I spread like a plague, for that is what I am~ |
|
|
| Report Abuse |
|
|
Stroniax
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 138 |
|
|
| 07 Aug 2012 01:16 AM |
Prev post was at doom
~I spread like a plague, for that is what I am~ |
|
|
| Report Abuse |
|
|
Stroniax
|
  |
| Joined: 22 Jul 2012 |
| Total Posts: 138 |
|
|
| 07 Aug 2012 04:39 PM |
@CHRIS that doesn't work
~I spread like a plague, for that is what I am~ |
|
|
| Report Abuse |
|
|
chris1989
|
  |
| Joined: 30 Nov 2007 |
| Total Posts: 2520 |
|
|
| 07 Aug 2012 07:43 PM |
| Works for me just put it in a script in workspace your weapons have to tag humanoids otherwise it wont work. So your doing something wrong. |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 07:48 PM |
game.Players.PlayerAdded:connect(function(p) local lead=Instance.new("IntValue",p) lead.Name="leaderstats" Instance.new("IntValue",lead).Name="KO" Instance.new("IntValue",lead).Name="Money" p.CharacterAdded:connect(function(c) repeat wait()until c["Humanoid"] h.Died:wait() if h["creator"]then (h["creator"]).leaderstats.KO.Value=(h["creator"]).leaderstats.KO.Value+1 (h["creator"]).leaderstats.Money.Value=(h["creator"]).leaderstats.Money.Value+5 end end) end) |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 07:50 PM |
game.Players.PlayerAdded:connect(function(p) local lead=Instance.new("IntValue",p) lead.Name="leaderstats" Instance.new("IntValue",lead).Name="KO" Instance.new("IntValue",lead).Name="Money" p.CharacterAdded:connect(function(c) repeat wait()until c["Humanoid"] h.Died:wait() if h["creator"]then (h["creator"].Value).leaderstats.KO.Value=(h["creator"].Value).leaderstats.KO.Value+1 (h["creator"].Value).leaderstats.Money.Value=(h["creator"].Value).leaderstats.Money.Value+5 end end) end)
Woops made some mistakes
just adjusted the above script a little |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2012 07:51 PM |
game.Players.PlayerAdded:connect(function(p) local lead=Instance.new("IntValue",p) lead.Name="leaderstats" Instance.new("IntValue",lead).Name="KO" Instance.new("IntValue",lead).Name="Money" p.CharacterAdded:connect(function(c) repeat wait()until c["Humanoid"] c["Humanoid"].Died:wait() if c["Humanoid"]["creator"]then (c["Humanoid"]["creator"].Value).leaderstats.KO.Value=(c["Humanoid"]["creator"].Value).leaderstats.KO.Value+1 (c["Humanoid"]["creator"].Value).leaderstats.Money.Value=(c["Humanoid"]["creator"].Value).leaderstats.Money.Value+5 end end) end)
qq forgetting how to script here |
|
|
| Report Abuse |
|
|