Home   Help Search Login Register  

Author Topic: Making a script global somehow (I need a lot of help today lol)  (Read 1249 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Hi
Hopefully this is my last question for today :-[

I have someone who locally executes a script via an action menu. Well the script that is activated requires another player to see some text (groupchat probably) and options. After the 2nd person who see's the the text, I want the 1st guy to join the 2nd guys squad.

The scripts I can do, but they are run locally. How would I make the 2nd guy see the text (so script is seen by him).

Im guessing making publicvariables.. but what do i publicvariable ?

Offline myke13021

  • Contributing Member
  • **
  • Myke
well, probably one solution could be to use a trigger.

in your (local) script insert a line:

Code: [Select]
MyChatVariable true; publicvariable MyChatVariable

then set up a trigger and in its condition field type

Code: [Select]
MyChatVariable

so as soon the variable becomes true (done in your first script), the trigger will fire and execute the commands in the on activation field (probably start the chat script)

Now wait for about 24houres and you'll get around 5 ways to do it better than my way.  :D

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
So make the script exec from a trigger thats publicly activated?
I try it tommorow, I dont have time now.

Offline myke13021

  • Contributing Member
  • **
  • Myke
afaik a trigger is local to each client, so if you put a variable that has to become true (or a certain value) as condition, and in a script you set this variable to the needed condition, then you publicvariable your variable, all triggers on clients will fire and execute the code or script you putted in on activation.

omfg, can someone tell me what i wrote. even myself i have problems to follow the sense of this phrase.  :blink: