|
| 08 Aug 2015 04:29 PM |
| What function would I use to get the brick that got clicked?(Script cannot be in the brick.) |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2015 04:31 PM |
--local script in StarterPlayer>StarterPlayerScripts
local plr = game.Players.LocalPlayer repeat wait() until plr local mouse = plr:GetMouse()
local function brickClicked(obj)
print(obj.Name) end
mouse.Button1Click:connect(function()if mouse.Target then brickClicked(mouse.Target) end end) |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2015 04:35 PM |
| I forgot to mention that this is for a plugin. Sorry |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2015 04:36 PM |
| ok remove the 'plr' line and define mouse |
|
|
| Report Abuse |
|
|
| |
|