local players = game.Players
local plr = game.Players.LocalPlayer
local char = plr.Character
local humanoid = plr:FindFirstChild("Humanoid")
local function EquipTool()
local tool = plr:WaitForChild("Sword")
if tool then
tool:EquipTool()
end
end
players.PlayerAdded:Connect(EquipTool)
I am trying to make a script that when a player joins, they instantly equip a tool
A tool that is equipped really just means that it is parented to the player’s character
So to make it where the player gets the tool when the spawn, just have the tool get parented to the character
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid") -- for character loading
local tool = plr.Backpack:WaitForChild("Sword") -- if the tool is in the player's backpack
tool.Parent = character
end)
end)