|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 03 Oct 2013 08:42 AM |
| So clickdetectors work even while having a tool equipped? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|