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 » Scripting Helpers
Home Search
 

Re: Tool Click on Object(Explanation In Post)

Previous Thread :: Next Thread 
SpecterSlash is not online. SpecterSlash
Joined: 29 Aug 2009
Total Posts: 629
03 Oct 2013 06:40 AM
So you know the ONCLICK function? When you click on a block, it does a script, that's the onclick function.
It can also tell which player clicked the block and can do something to that player.

Is this function possible with a tool? I'd like to test this with a damage script.
Lets add a damage script to BRICKDMG that will damage whoever clicks the script WITH A HOPPERBIN.
I use the HOPPERBIN tool and click the BRICKDMG with it. How do I do this?

How do I get the hopperbin tool to click a brick and do damage to the player.
Also, I dont want the damage script to be in the hopperbin, I want it to be in the BRICKDMG.

I'll try to explain it like this:

Onclick function can detect who clicked the brick and executes the script WITHIN the brick
Hopperbin tool script can do something to the brick, but how can the brick tell who clicked it?
Report Abuse
SpecterSlash is not online. SpecterSlash
Joined: 29 Aug 2009
Total Posts: 629
03 Oct 2013 06:43 AM
I'll add a little bit more explanation its hard to explain

Onclick --> brick
brick can check who clicked the brick and do something to the clicker

hopperbin click --> brick
how does brick check who clicked the brick?
Report Abuse
DragonODeath is not online. DragonODeath
Joined: 02 May 2011
Total Posts: 1252
03 Oct 2013 07:11 AM
There is no such thing as an onclick function. You could name a function anything as you like. Learn to script.
ClickDetector checks who clicked the brick through the MouseClick event.
Report Abuse
SpecterSlash is not online. SpecterSlash
Joined: 29 Aug 2009
Total Posts: 629
03 Oct 2013 07:46 AM
So how do I check who clicked the brick if I clicked the brick with a HOPPERbIN tool?
Report Abuse
sam8985 is not online. sam8985
Joined: 12 Nov 2011
Total Posts: 582
03 Oct 2013 08:27 AM
In English:

When a player equips the hopperbin, change a boolvalue in the player to true.
When a player unequips the hopperbin, change the boolvalue to false.
When the click detector brick is clicked, check if the boolvalue in the player is true. If so, damage the player.
Report Abuse
SpecterSlash is not online. SpecterSlash
Joined: 29 Aug 2009
Total Posts: 629
03 Oct 2013 08:42 AM
So clickdetectors work even while having a tool equipped?
Report Abuse
sam8985 is not online. sam8985
Joined: 12 Nov 2011
Total Posts: 582
03 Oct 2013 04:45 PM
Actually, I don't think so... Bad idea on my part.
Report Abuse
PropheticExtinction is not online. PropheticExtinction
Joined: 16 Nov 2008
Total Posts: 5686
18 Jun 2014 02:42 AM
I would like to know how to check who clicked the brick/button as well for a script I am making. Anyone know how to do this?


PʀᴏᴘʜᴇᴛɪᴄExᴛɪɴᴄᴛɪᴏɴ ~ Tʜᴇ ᴍɪɢʜᴛʏ Dɪɢɴɪᴛᴀʀʏ ᴏғ EXTINCT
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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