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 » Scripting Helpers
Home Search
 

Re: Is it possible?

Previous Thread :: Next Thread 
Stroniax is not online. 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
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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