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.
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)