I am not that good at scripting, especially when tracking down errors . That is why I want to ask you for help
here is a bit of the code:
game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
repeat wait() until Character.Humanoid
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
Player:LoadCharacter()
repeat wait() until Character.Humanoid
wait(2)
local hum = Character:WaitForChild("Humanoid")
if Player.TeamColor == BrickColor.new("Bright blue") then
Character:WaitForChild("Humanoid"):EquipTool(Player.Backpack:WaitForChild("M4A1-S"))
elseif Player.TeamColor == BrickColor.new("Bright yellow") then
Character:WaitForChild("Humanoid"):EquipTool(Player.Backpack:WaitForChild("AK47"))
end
end)
end)
end)
I tried multiple ways of fixing it but I always end with the same results:
UnequipTools can only be called on a Humanoid with a corresponding Player object.
It's been annoying me. I will be glad if you are able to help me out a bit.

1 comment
you could just parent the tool to the charcter.... e.g.. tool.Parent = player.Character