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

Killstreak help? (SOLVED!!)

Asked by 10 years ago
repeat wait()
Player = game.Players.LocalPlayer
until (Player) and (Player.Character)

Player:WaitForChild("leaderstats").Streak.Changed:connect(function() 
    if Player.leaderstats.Streak.Value >= 1 then 
        game.ReplicatedStorage.AC130:Clone().Parent = Player.Backpack
    end
end)

This is the code, I can't find the problem

0
This is really the 3rd time I asked this question, none of them worked supermarioworld323 45 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

Just use this, a lot of times using repeat and :WaitForChild() glitch:

local Player = game.Players.LocalPlayer
local ToolName = "AC130" --Put the name of the tool here
Player.CharacterAdded:wait()
wait(1)

Player.leaderstats.Streak.Changed:connect(function(value)
    if value >= 1 then
        if not Player.Backpack:FindFirstChild(ToolName) then
            game.ReplicatedStorage[ToolName]:Clone().Parent = Player.Backpack
        end
    end
end)
0
thanks, I will try this out supermarioworld323 45 — 10y
0
i got Workspace.Script:3: attempt to index local 'Player' (a nil value) supermarioworld323 45 — 10y
0
Put this in a LOCALSCRIPT! lightpower26 399 — 10y
Ad

Answer this question