Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Plugin Methods

Asked by
Trewier 146
10 years ago

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)
0
This getting the plugin mouse is buggy or requires something different. :P FromLegoUniverse 264 — 10y
0
I'm sorry, what? Trewier 146 — 10y

1 answer

Log in to vote
-2
Answered by 10 years ago

"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)
2
Read ALL the post before making a useless post. mouse is already defined. Trewier 146 — 10y
Ad

Answer this question