Welcome to the Builder Academy

Question Block exits If char is below level 40

More
05 Feb 2018 23:39 - 06 Feb 2018 12:43 #7542 by JTP
Im trying to make a trigger for a room with NSEW exits. Buft If the char is below level 40 they cant go N or S or E....only W.

And Then send a %echo% message
And two tell %actor% messages.


But i Can only Seem to block one of the dirs. And it only sends the %echo% message, not the two tells.

Anyone ever tried something similar ?


Right now im trying:
Code:
if %actor.level% < 40 && %direction% == north || %direction% == east || %direction% == south return 0 %echo% bla bla bla wait 1 s tell %actor% bla bla bla tell %actor% bla bla bla end
If i try go any of the 3 directions then im stopped and i get the echo message, not the 2 tells.

BUT if i try walk in any of the dirs 2 times in a row, then i stopped 1st time with the echo, but second time i pass anyway

Whats up ?
Last edit: 06 Feb 2018 12:43 by JTP.

Please Log in or Create an account to join the conversation.

More
06 Feb 2018 14:53 #7543 by Treblin
I don't recall the exact syntax off the top of my head and not able to pop in the shell atm, but look at the guild guard example this I believe should send you in the right direction.

Please Log in or Create an account to join the conversation.

More
06 Feb 2018 14:58 #7544 by JTP
That is what i started out with, and works Well for 1 direction, even when repeatably trying to walk there. And it Uses send actor


But this has 3 blokked exists and an echo and two tells.

Please Log in or Create an account to join the conversation.

More
06 Feb 2018 21:25 #7546 by thomas
Several things:
Logic like that requires parenthesis.
Code:
foo && bar || baz || top
is true if
- foo and bar is true
- or baz is true
- or top is true
You will instead want
Code:
if %actor.level% < 40 && (%direction% == north || %direction% == east || %direction% == south)

Second, only one instance is allowed to run at a time for a given context. And, once you've triggered the wait, the script is considered running. So try to go north, get the message, and then try to go north again within the waiting period, and the trigger won't fire again. In practice, send the messages immediately.

Third - I'm unsure if "tell" works like that. I think you'll either want "tell %actor.name% ..." or "%send% %actor% ..."

Please Log in or Create an account to join the conversation.

More
06 Feb 2018 21:33 #7548 by JTP
Yea actor.name was needed and Then the ()

Thanks alot

Please Log in or Create an account to join the conversation.

Time to create page: 0.242 seconds