Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Killstreak help? (SOLVED!!)

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

1 comment

0

This is really the 3rd time I asked this question, none of them worked

1 answer

✓ Accepted answer

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)

3 comments

0

thanks, I will try this out

0

i got Workspace.Script:3: attempt to index local 'Player' (a nil value)

0

Put this in a LOCALSCRIPT!

This discussion is preserved as it was. New answers, comments, and votes are closed.