FE gun kit viewmodel not working correctly with :EquipTool()

Hello everyone! I’ve been messing around with the FE gun kit and trying to make it seem really cool. I’m trying to make the guns equip when you spawn, like in Arsenal and stuff, but each time I do that the gun destroys itself after about 3 seconds, like it’s unanchored or something.

The server script code:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		for _, v in pairs(plr.Backpack:GetChildren()) do
			if v:IsA("Tool") and v:FindFirstChild('equipPriority') then
				char:WaitForChild('Humanoid'):EquipTool(v)
			end
		end
	end)
end)

Video:

Their discord just returns a invalid invite, so I can’t ask there… I’ve also seen a couple of games do this exact thing, but I don’t know how they fixed this.

Edit: Found the right invite, will see if I get a response

You probably don’t want to have the tool equip immediately after the character is added then. Other logic, both internal and the gun code itself, may not have enough time to initialise by the time you’re calling EquipTool which causes the tool not to attach itself to the character and therefore fall through.

2 Likes

How could I make sure the player has fully loaded in?

Nevermind, found it:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAppearanceLoaded:Connect(function(char2)
		for _, v in pairs(plr.Backpack:GetChildren()) do
			if v:IsA("Tool") and v:FindFirstChild('equipPriority') then
				v.Parent = char2
			end
		end
	end)
end)

Thanks!