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

Why does this script don't give me the "kill streak" reward?

Asked by 9 years ago
local plr = game.Players.LocalPlayers

if plr.Killstreak.Value >1 then
    local p = game.Lighting.AC130:clone()
    p.Parent = plr.Backpack
end

I can't find what seems to be the problem

0
Sorry I just started scripting like a few weeks ago supermarioworld323 45 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

How about checking every time it changes?

LOCALSCRIPT

local Player = game.Players.LocalPlayer --Not Plural

Player.Killstreak.Changed:connect(function()
    if Player.Killstreak.Value >= 3 then --Checks if your killstreak is bigger or equal to 3
        game.ReplicatedStorage.AC130:Clone().Parent = Player.Backpack
    end
end)

--[[I prefer ReplicatedStorage to Lighting since it's newer and probably better. Consider moving the AC130 to ReplicatedStorage]]--
0
Omg thanks it actually works! supermarioworld323 45 — 9y
0
wait nvm it only works on LinkedLeaderboard supermarioworld323 45 — 9y
Ad

Answer this question