Contens
Introduction
How to use
How to use(Example)
FAQ
Credits
Introduction
Trigger_If is a entity that allow you to use if statement on lua scripts
How to use
Put Trigger_If on your map, fill the "name", "trigger", and Condition. Condition can be this way
entity(0,0,"typename")=="Trigger Delay"
or you can see 2 examples at there
then link it with a Trigger_Use, Hit, Move, etc.
How to use(Example)
1. create 2 CT spawnpoint with different name(ct1 and ct2) and 1 T spawnpoint(to prevent crash)
2. create Func_DynWall and 2 Trigger_Use(1 trigger CT spawnpoint(ct2) and another to trigger the Trigger_If)
Hint: it should like this
3. Create Trigger_If and Fill the condition this way:
1
entity(2,0,'state')==true
Tile 0|0 Info_T
Tile 1|0 Info_CT Name: ct1
Tile 2|0 Info_CT Name: ct2
Tile 2|4 Trigger_Use Trigger: iftest Button: Lighted Red
Tile 2|6 Trigger_Use Trigger: ct2 Button: Red Alarm
Tile 3|5 Func_DynWall Name: dwall Tile: 0
Tile 3|4 Trigger_If Name: iftest Trigger: dwall Condition: entity(2,0,'state')==true
Note: Name, Trigger are in case sensitive
4. Make sure that Trigger_If trigger the Func_DynWall and 1 Trigger_Use trigger the Trigger_If
5. Save the map and test it. And make sure there is a 6 bots with CT
6. It should spawn on 2 spawnpoint
7. okay go to Trigger_Use that linked to Trigger_If and press "Use" key
8. If it works fine the door should not open, go to Trigger_Use that linked to Info_CT(with name ct2) and press "use" key
9. Try to kill yourself 10 times to MAKE sure that there is a only 1 spawnpoint
10. If it works fine you should ALWAYS spawn on Info_CT(with name ct1)
11. Repeat step 7 and see if it works. If it works fine the door should open
12. If it open you did it right, but if not seems that you did something wrong. Retry again the tutorial
FAQ
Q: Can i use a variable that used on my lua scripts?
A: Yes
Q: Can i use a returned function value as value of the statement?
A: Yes, function values r just as valid as variable and constant values
Q: Can i use function instead of variable that on my lua scripts?
A: Of course you can
Q: Can i create script with Trigger_If?
A: Yes you can for example this file Automated Shop (21)
Q: Is a allowed to load scripts from Trigger_If?
A: Of course, it's gonna used on RL Roleplay Citylife's map. Just create Trigger_If and fill the condition this way:
1
dofile("<Luapath>")
Credits
omg - He tell me the answer of the FAQ 2
Apache uwu - He PM me, i ask "can i put your files as another example". you can see it at FAQ 4
VADemon - See FAQ 5
Marked as Inportant thread. I hope this thread marked as important
Note: Correct me if im wrong
edited 5×, last 08.08.12 01:38:42 pm