I am trying to make a script that gives a player a tool based on a value. For some reason, it does not give the player the tool.
game.Players.PlayerAdded:Connect(function(plr)
local rep = game:GetService("ReplicatedStorage")
local tools = rep:FindFirstChild("Tools")
local redbull = plr:FindFirstChildWhichIsA("IntValue")
if redbull == 0 then
print("No value")
else
wait(1)
plr.Backpack:FindFirstChild("RedBull"):Destroy()
for i,v in pairs(tools:GetChildren()) do
local tool = v
if tool.Stats.BullValue.Value == redbull then
tool:Clone().Parent = plr.Backpack
end
end
end
end)
