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

Does anyone know how to get the mouse in a plugin?

I'm trying to find the mouse of the player inside a plugin Does anyone know how to get the mouse of a person who pressed a plugin?

local plugin = PluginManager():CreatePlugin()
local toolbar = plugin:CreateToolbar("test")
local button = toolbar:CreateButton("test", "test", "test.png")

button.Click:connect(function()
	mouse = GetMouse()
	mouse.Button1Down:connect(function()  --This isn't working 
		print("Button 1 pressed from PluginMouse")
	end)
end)

3 comments

0

What's the error?

1

You have to call 'GetMouse()' on 'plugin', for instance, 'local mouse = plugin:GetMouse()'

0

If that answered your question, please put 'Answered' in the title.

1 answer

✓ Accepted answer

Plugin manager is no longer required as Plugin is a global keyword even though it recognizes it as a unknown global use #In a ModuleScript

local Mouse=Plugin:GetMouse()

to get the mouse but you have to test it as a regular function for it to work.

1 comment

0

Please rep if you like the answer

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