Author Topic: Event: Not sure what to name it :/  (Read 1035 times)

I would like an event that is like the "iflastplayermessage=" except it is the last event instead. This could be used in RPGs to easily add a "cooldown" effect to gathering herbs/cutting down trees...

For a "cooldown" effect on a brick's events, use setEventTimeout.
Or, if you want it to be per client, use variable events and relays.

Not ure what you mean. I wnt something so that you can, say, chop a tree down, then be unable to do it for a certain amount of time. I mean on a different brick too, not just the one tree.

Truce explained it; go read it again. Also, die.

Wait, help me understand this.
You want it so that if in a future RPG someone says;
"Computer, lights on"
then the lights would turn on?

No, I wanted an event that checks the last event that player made happen. It would be a variable such as:
Code: [Select]
ifLastPlayerEvent -> [Event Here]
VariableTrue -> [Different Event Here]

Why not just on activate fake kill brick for a certain amount of time? From what you say it seems like you just want them to not be able to chop a tree down for a limited time. If you don't want them to chop another tree down for a while you can just use variables.

hao2use variable to stop them using other events?

setEventTimeout prevents a brick's events from being activated for a certain period of time, and will call onTimeout if the brick is e.g. activated, touched, etc. in between that period for your "You can't mine that fast!" message or whatever.

If you hate on timeout you could just do On activate player add variable mining time 1 then a few seconds later mining time -1 and then do if variable player mining time equals 0 then whatever.

I don't even know what timeout is though. I don't have said event.

If you hate on timeout
Then he shouldn't be asking people to code something that performs the exact same function.

Well you already explained on timeout. .__.

Tom

If your using onActiveate/onProjectileHit you could just use ray-casting - you don;t even need any event add-ons.

Code: [Select]
[000]onActivate -> Self -> setRaycasting [ ]
[500]onActivate -> Self -> setRaycasting [X]

I think he wants other people to be able to use that brick though.

hao2use variable to stop them using other events?

For example:

Code: [Select]
(0) onActivate -> Self -> ifVariable (Client, lastEvent, NotEquals, 1)
(0) VariableTrue -> Client -> setVariable (lastEvent, 1)
(10000) VariableTrue -> Client -> setVariable (lastEvent, 0)
(0) VariableTrue -> Client -> addVariable (logs, 1)
(0) VariableTrue -> Client -> CenterPrint ("You got a log.")
« Last Edit: January 12, 2009, 04:55:58 PM by Truce »