Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How and how to fix "this Mouse is not Activate" client bug in tools?

This extremely short and easy script cause an error.

local tool = script.Parent

tool.Equipped:connect(function(mouse)
	tool.Activated:connect(function()
		print(mouse.Target)
	end)
end)

At first when the tool was equipped and activated by a player then the functions work correctly as it should.

But when they reequip it and activate it again. The mouse will deactivate itself and cause an error

1 comment

0

You need to disconnect the event after its unequipped. The mouse passed it the equipped event will disconnect all events for you when the tool is unequipped.

1 answer

Have you tried putting this in a local script:

local tool = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse()

tool.Activated:Connect(function()
	print(mouse.Target)
end)

1 comment

0

Yes I've tried it. It worked correctly but the question here is how and how to fix without using this solution

This discussion is preserved as it was. New answers, comments, and votes are closed.