Need help to make a killing script link with my coin one

so i making a sword game and i want to add a kill leader board i already have a coins one but i do not know how to add a kills one that links to a sword this is a image of my current leader board coding

Just make another value called Kills.
For example:

local Kills = Instance.new("IntValue")
Kills.Name = "Kills"
Kills.Value = 0
Kills.Parent = leaderstats
2 Likes

but then will it link to every one i kill some one it goes on the leaderboard

1 Like

So you are attempting to create a global leaderboard where everyone’s values are stored?

2 Likes

yes i want like a leaderboad that says for every one there kills

1 Like

Simple, create an ordered data store. Save everyone’s kill values and update the leaderboard from time to time using a loop. This will show everyone’s kill values even if they aren’t in the game.

1 Like

how do i do that sorry i dont realy understand a lot of coding :frowning:

1 Like

I’m sure there are plenty of tutorials on how to accomplish this, just follow the steps they provide.

1 Like

i tryed a tutorial but when i used the script it didnt come on the leader stats thats why i came to dev forum to ask for help

1 Like

Then go to another tutorial or you can learn a lot from a free model. You may not ask scripts.

1 Like

How to make a simple global leaderboard i hope this tutorial helps.

1 Like

ok thank you a lot i will watch it

1 Like

wait no i dont want a golbal leaderbord i mean
i want like a normal leaderbord thats in game and show the ammount of kill for each person in the server not for every one

1 Like
--In a script on the server somewhere...


--Connect a function that will run when a player joins,
game.Players.PlayerAdded:Connect(function(player) --player is defined
    --Create a folder to hold the leaderstats
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    --Create a value object to hold the cash
    local cash= Instance.new("IntValue")
    cash.Name = "Cash"
    cash.Parent = leaderstats

    --Create a value object to hold the kills
    local kills = Instance.new("IntValue")
    kills.Name = "Kills"
    kills.Parent = leaderstats
--End off event
end)

Will add both cash & kills to your leaderstats. (Assuming you don’t mean a global leaderboard)

If you have any questions, don’t hesitate to ask!

thank you a lot i will try the script now

nice thank you so much it works but do you know when i kill some one how will i like it to the leaderstats