Tool not parenting to player Model when equipped

Basically I want to make a tool that highlights players when you click them with the mouse.
I’ve got a local script that is responsible for the mouse input and firing the remote event and stuff.
I won’t show the code because the local script works 100%,

I’ve got a server script in the tool that handles the events and makes it so the player is highlighted
the code:

print("testing")
script.Parent:WaitForChild("RemoteEvent").OnServerEvent:Connect(function(player, target,trueorfalse)
	print("testing")
	if trueorfalse then
		local mark = Instance.new("Highlight")
		mark.Parent = target.Character
	else
		target.Highlight:Destroy()
	end
	
end)

Basically the problem is that the tool doesnt go to the workspace when equipped and it makes the server script not work idk why.

If you are not using the default tool code. You would need to equip it on the server in order for the server to see it.

What do you mean by default tool code? like the remote event when its equipped?

By default tools have code that equips and dequips them when you press on them in the default backpack ui or press a hotkey

This suggests you are not relying on that. Which means you have to manually equip the tool. The server script you provided doesn’t have any code which equips the tool.

You would do

humanoid:EquipTool(tool)

on the server, whenever you want to equip the tool. (which could be connected to a remote event if you want)

It’s ok i found out why it’s not working ty anyways xd.
sorry for not explaining myself good enough my english isnt very good.

1 Like

Apparently it was in my toolbar but not in my backpack so i think it didnt replicate or smth the tool when i gave it to the player.