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
 

How to implement a kill count system into my leaderstat?

Previous Thread :: Next Thread 
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 08:37 AM
Im new to scripting so I dont know where to start with this.. -------------------------------------------------------- game.Players.PlayerAdded:connect(function(plr) local leaderstats = Instance.new("Folder", plr) leaderstats.Name = "leaderstats" local rank = Instance.new("StringValue", leaderstats) rank.Name = "Rank" rank.Value = "Recruit" local cash = Instance.new("NumberValue", leaderstats) cash.Name = "War Bonds" cash.Value = 500 local supplies = Instance.new("NumberValue", leaderstats) supplies.Name = "Supplies" supplies.Value = 0 local kills = Instance.new("NumberValue", leaderstats) kills.Name = "Kills" kills.Value = 0 --RANK SYSTEM kills.Changed:connect(function() if kills.Value >= 2 then rank.Value = ######## I" end --END RANK SYSTEM end) end)
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 08:37 AM
############################################## local leaderstats = Instance.new("Folder", plr) leaderstats.Name = "leaderstats" local rank = Instance.new("StringValue", leaderstats) rank.Name = "Rank" rank.Value = "Recruit" local cash = Instance.new("NumberValue", leaderstats) cash.Name = "War Bonds" cash.Value = 500 local supplies = Instance.new("NumberValue", leaderstats) supplies.Name = "Supplies" supplies.Value = 0 local kills = Instance.new("NumberValue", leaderstats) kills.Name = "Kills" kills.Value = 0 --RANK SYSTEM ################################ if kills.Value >= 2 then rank.Value = ######## I" end --END RANK SYSTEM end) end)
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
21 Mar 2017 08:49 AM
use pastebin so I can read it
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:03 AM
############################
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:04 AM
#####################################################
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:04 AM
game.Players.PlayerAdded:connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"

local rank = Instance.new("StringValue", leaderstats)
rank.Name = "Reputation"
rank.Value = "Grunt"

local cash = Instance.new("NumberValue", leaderstats)
cash.Name = "War Bonds"
cash.Value = 500

local supplies = Instance.new("NumberValue", leaderstats)
supplies.Name = "Supplies"
supplies.Value = 0

local kills = Instance.new("NumberValue", leaderstats)
kills.Name = "Kills"
kills.Value = 0
--RANK SYSTEM
ki################################
if kills.Value >= 5 then
rank.Value = "Soldier"
if kills.Value >= 10 then
rank.Value = "Proven"
if kills.Value >= 25 then
rank.Value = "Loyal"
if kills.Value >= 35 then
rank.Value = "Honorable"
if kills.Value >= 50 then
rank.Value = "Feared"
if kills.Value >= 60 then
rank.Value = "Savage"
if kills.Value >= 75 then
rank.Value = "Warmongering"
if kills.Value >= 80 then
rank.Value = "Warlord"
else
rank.Value = "Grunt"
end
end
end
end
end
end
end
end


--END RANK SYSTEM

end)
end)
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
21 Mar 2017 09:05 AM
just post the part after the /
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:07 AM
The hashtags say ################################
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:08 AM
screw it heres a pastebin c47Kn1Cd
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
21 Mar 2017 09:08 AM
I'm not exactly sure what you want but

If what you want is for a player's "kills" to update every time they kill someone
you're gonna have to update every weapon in your game to increase their kills by 1 every time they kill someone.

The simplest way to do that is after the damage has been dealt, check if the target's HP is greater than 0, if so increase the player's kills and be sure to put a debounce so it doesn't trigger multiple times per kill.
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:10 AM
Theres no way I can do this with the leaderboard script itself?
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
21 Mar 2017 09:12 AM
well it's gonna be a lot more complicated if you do it from the leaderboard script

a lot simpler when done from the weapon itself.
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:14 AM
The thing is, my friend and I are developing this game and I didnt make the gun scripts he did, and he already created over 25 guns... Do you know the way to just make it universal with the leaderboard itself?
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
21 Mar 2017 09:19 AM
Just find the part where the gun deals damage and do that there, not too hard if you code, and seeing as you can I suggest you do that. And besides, if the guy who made the guns is better than you you can learn new things from it. Also if the guns were made by the same person the part where it deals damage should be the same.
Report Abuse
NovusPluvia is not online. NovusPluvia
Joined: 09 Jan 2012
Total Posts: 297
21 Mar 2017 09:19 AM
I actually did it! Thank you so much!
Report Abuse
ArmaVictorem is not online. ArmaVictorem
Joined: 18 Mar 2015
Total Posts: 1332
21 Mar 2017 09:20 AM
or ask your friend to do it, either works.
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