generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Get the brick that got clicked.

Previous Thread :: Next Thread 
antonio6643 is online. antonio6643
Joined: 30 Aug 2009
Total Posts: 791
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
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
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
antonio6643 is online. antonio6643
Joined: 30 Aug 2009
Total Posts: 791
08 Aug 2015 04:35 PM
I forgot to mention that this is for a plugin. Sorry
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
08 Aug 2015 04:36 PM
ok remove the 'plr' line and define mouse
Report Abuse
antonio6643 is online. antonio6643
Joined: 30 Aug 2009
Total Posts: 791
08 Aug 2015 04:51 PM
Thanks!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image