EquipTool() doesn't actually equip the tool

  1. What do you want to achieve? I want to equip a specified tool when firing the event

  2. What is the issue? it just doesn’t respond

  3. What solutions have you tried so far? Rewriting the script and checking if everything is server-sided

the script is placed in ServerScript Service as a normal script and both of the print functions return output

server script service

local event = rep:WaitForChild("Equip")

event.OnServerEvent:Connect(function(plr, tool)
	game.Workspace:FindFirstChild(plr.Name).Humanoid:UnequipTools()
	wait(.01)
	print("unequipped")
	game.Workspace:FindFirstChild(plr.Name).Humanoid:EquipTool(tool)
	print("equipped")
end)

local script to fire the event


local event = rep:WaitForChild("Equip")

script.Parent.MouseButton1Down:Connect(function()

game.Players.LocalPlayer.Character.Humanoid:EquipTool(game.Players.LocalPlayer:FindFirstChild(script.Parent.Text))

event:FireServer(game.Players.LocalPlayer, game.Players.LocalPlayer.Backpack:FindFirstChild(script.Parent.Text))

end)```

could anyone help me or does anyone have the same issue?

all answers/comments are appreciated thx!

rep is actually mentioned
local rep = game:GetService(“ReplicatedStorage”)

:FireServer doesn’t need player as the first argument so tool in the server script is the player.

1 Like

Yup what FlashFlame said.

Look at this article:- Custom Events and Callbacks | Documentation - Roblox Creator Hub

You dont need to reference the player. So just remove it and it should work.

Remember that only :FireClient Requires player object as the first argument

1 Like

wow! that actually makes sense in my 3-years of experience I’ve never known this!

tysm!