This is what i use to do it. It is similar to the Touched script in a brick. I just give a random example(this would kill a zombie if the mouse went over it.)
function Run(mouse)
local hit = mouse.Target
if (hit == nil) then return end
h = hit.Parent:FindFirstChild("Zombie")
if h ~= nil then
h.Health = 0
end
end
end
function on(mouse)
while true do
wait()
Run(mouse)
end
end
script.Parent.Equipped:connect(on) |