Tool Giver Script Not Working

Hello,

I’ve created a script that is supposed to give me a tool upon join,

my issue is that the tool does not clone without any errors and yet the print still fires.

  • this is a normal script located in ServerScriptService

As you can see in the image, the print is called, but the tool is missing:
Screen Shot 2021-03-10 at 6.36.17 PM

game.Players.PlayerAdded:Connect(function(Player)
	local PlrStats = Player:WaitForChild("PlayerStats")
	local Lvl = PlrStats.WandLvl.Value
	local SS = game:GetService("ServerStorage")
	if Player then
		if Lvl == 0 then
			local Wand = SS.Wands:WaitForChild("Magic Stick")
			Wand:Clone().Parent = Player.Backpack or Player.Character
			print("asddsgbdljuhb")
		end
	end
end)
1 Like

You don’t need the or statement in there, just put it in the Player’s Backpack

1 Like

I’ve tried that but the tool still does not clone. Regardless, it should be cloned anyways because the print is being called.

1 Like

Try this then?

		if Lvl == 0 then
			local Wand = SS.Wands:WaitForChild("Magic Stick"):Clone()
			Wand.Parent = Player.Backpack or Player.Character
			print("asddsgbdljuhb")
		end
1 Like

Removed the if Lvl == 0 then and the end, yet the tool is still not being cloned

1 Like

Not to be dumb but just making sure Is the Tool an actual Tool object? If it is, then maybe something didn’t load entirely on time?

1 Like

It’s an actual tool object with handle

1 Like

Try adding a wait(5) from within the PlayerAdded event

1 Like

I’d put it under a CharacterAdded event just to be sure.

1 Like

Try wrapping another wait loop around your Wands folder:

local Wand = SS:WaitForChild("Wands"):WaitForChild("Magic Stick")
1 Like

Make sure the tool is actually in the player’s backpack

game.Players.PlayerAdded:Connect(function(Player)
	local PlrStats = Player:WaitForChild("PlayerStats")
	local Lvl = PlrStats.WandLvl.Value
	local SS = game:GetService("ServerStorage")
	if Player then
		if Lvl == 0 then
			local Wand = SS.Wands:WaitForChild("Magic Stick")
			Wand:Clone().Parent = Player.Backpack or Player.Character

			for _, child in ipairs(Player.Backpack:GetChildren()) do
                print(tostring(child.Name))
            end
		end
	end
end)