| Blockland Forums > Modification Help |
| Multi-clicking a brick? |
| (1/4) > >> |
| slimabob:
How would I make it so that you have to click a brick multiple times before something happens? (In a script). I know this can be done with events, but I have something in mind if I can just figure this out. |
| MegaScientifical:
--- Quote from: slimabob on March 08, 2011, 12:06:41 AM ---How would I make it so that you have to click a brick multiple times before something happens? (In a script). I know this can be done with events, but I have something in mind if I can just figure this out. --- End quote --- You could look at the guys event code and adapt it as pure code... Eventing only makes the code work within an event, you know. |
| Iban:
--- Code: ---function fxDTSBrick::onActivate(%this, %obj, %client, %pos, %rot) { %this.activatedByObj[%obj.getID()]++; %this.activatedByClient[%client.getID()]++; echo("Brick #" @ %this.getID() SPC "has been clicked by this player" SPC %this.activatedByObj[%obj.getID()] SPC "and this client" SPC %this.activatedByClient[%client.getID()] SPC "times."); return parent::onActivate(%this, %obj, %client, %pos, %rot); } --- End code --- This will tally how many times a player and client have clicked a brick. If there's any syntax errors I need to iron out that you can't resolve, just post. --- Quote from: MegaScientifical on March 08, 2011, 01:07:26 AM ---You could look at the guys event code and adapt it as pure code... Eventing only makes the code work within an event, you know. --- End quote --- Please don't ever post in coding help again. |
| slimabob:
--- Quote from: Iban on March 08, 2011, 01:17:28 AM ----helpsnip- --- End quote --- Thanks a ton. I'll start looking at this trying to get it to work right away. EDIT: When it says: --- Quote from: Iban on March 08, 2011, 01:17:28 AM --- --- Code: --- echo("Brick #" @ %this.getID() SPC "has been clicked by this player" SPC %this.activatedByObj[%obj.getID()] SPC --- End code --- --- End quote --- Would it say "Has been clicked by this player"? Or is it just checking if it "has been clicked by this player"? Sorry, I'm still kind of new to scripting. |
| MegaScientifical:
--- Quote from: Iban on March 08, 2011, 01:17:28 AM ---Please don't ever post in coding help again. --- End quote --- Where the hell did that come from? He said he wanted things to happen only after a certain amount of clicks, and mentioned he knows there are events that do it. So I suggested examining that code. The code you provided doesn't even work the way he wants. That's just a click counter, without resets or any help on how to do that. Seriously though, and I'm asking this seriously, where the hell did that come from? |
| Navigation |
| Message Index |
| Next page |