Force Equip Script

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

1 Like

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)

Should be a server script ^

1 Like

I have it in server script storage

Also I’m trying to make the humanoid equip the tool

demo place.rbxl (38.4 KB)

I created a demo place that clones the sword that is under the script (following the code made in my previous post)
See if this suits your needs

1 Like

Just put the tool in StarterCharacterScripts.

What would it do if I were to put the tool in StarterCharacterScripts?

When the player’s character is loaded, Everything in StarterCharacterScripts gets cloned to the character.

1 Like

you cant run localscripts in serverscriptservice

It isn’t a localscript? It’s a server script.

you are using game.Players.LocalPlayer

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.