Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How do you make a "killstreak" script?

Asked by 9 years ago

I was wondering how you can make a script that states, "If you get 15 kills without dieing, you will get a special sword"

1 answer

Log in to vote
0
Answered by 9 years ago

You have to create first a leader board script. Then you must make on of the leaderboard's name "Killstreak", or something similar that helps users identify it. Make it so if the player dies, the Killstreak changes to 0. You can create a leaderboard like this: (Place this script in workspace)

game.Players.PlayerAdded:connect(function(player)
    local leaderstats = Instance.new("Model", player)
    leaderstats.Name = "leaderstats"

    local money = Instance.new("IntValue", leaderstats) --We instance a new IntValue as a child of 'leaderstats'
    money.Name = "Killstreak" --this is the name you want the leader-stat to be when it shows up in-game.
    money.Value = 0 --
 end)

Then, make it so if the player dies, the Killstreak changes to 0. And when the player kills it add's up the value, you can find many scripts that do this in the ROBLOX catalog, and then learn from their code.

Then, put a script in the backpack of the player (makes it easier) that goes like this:

sword = game.Lighting.SWORDNAME:clone()

if script.Parent.Parent.leaderstats.killstreak.Value >= 15 then
    sword.Parent = script.Parent
end

There', its that simple :D

Ad

Answer this question