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

Plugin Methods

Hello, so I am making a plugin that does something when you click. So what I want to happen is: Player clicks plugin button Player clicks in workspace wherever they want Function executes and spawns block at that location Function resets so it can be used again

But, when I click on the button, and then click in Workspace, nothing happens. If you could help me it would be greatly appreciated.

Note: spawnBlock is already declared, as well as mouse, and button.

button.Click:connect(function()
	mouse.Button1Up:connect(function()
		spawnBlock(mouse.Origin)
	end)
end)

2 comments

0

This getting the plugin mouse is buggy or requires something different. :P

0

I'm sorry, what?

1 answer

"mouse" is not defined, you need to define it before it works:

button.Click:connect(function(mouse) -- Add "mouse" as a parameter
	mouse.Button1Up:connect(function()
		spawnBlock(mouse.Origin)
	end)
end)

1 comment

2

Read ALL the post before making a useless post. mouse is already defined.

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