Rank: Veteran Forum Member Joined: 7/5/2020(UTC) Posts: 7,162
|
Originally Posted by: Viegoth Originally Posted by: SEAN_DAVIS Hey Viegoth is it possible to say add like a light switch to click to turn things on and off
I haven't gotten to that chapter yet!
Yes, it is possible... using the Trigger Linked Script and the Clickable Trigger state.
Since you asked, let's cover that one next.
Trigger Linked Script:
This is actually an old script 'PasstoLinkedProp' that was given new life.
For those who don't know what 'PasToLinkedProp' did, it allowed you to use a Trigger Box prop, link it to a VIP Rope or Gender Block script, and detect when someone tried to cross the rope. Non-VIP members weren't allowed to pass a VIP rope, and if your gender didn't match the setting on Gender Block, you couldn't pass.
The new version of this script 'Trigger Linked Script' is now usable across a multitude of different scripts. Nearly every script that does something can be 'linked' to a trigger.
You can use this script in the normal fashion, by adding it to a Trigger Box prop, and use it to trigger when someone enters or exits the area defined by the trigger box.
But, you can also use it by adding it to just about any prop, and setting the 'Clickable Trigger' state on the State tab, to use that prop as the trigger to activate another script on a different prop.
I know... your head just exploded, right? "Is he talking light switches to turn things on and off?"
Yes, you can even use it to turn lights (Light Source, Light Area) on and off.
There are 4 parameters on the Trigger Linked Script...
- Target Prop ID
- Reversed Trigger
- Trigger on Enter
- Trigger on Exit
The Target Prop ID is the ID of the prop you want to trigger the script on.
There is a neat little button on the Prop Editor which makes it really easy to get this. Edit the prop you intend to trigger, then click the PID button to copy that prop's ID to your clipboard.
Once you have this PID, just paste it into the parameter box of the Trigger Linked Script.
You can simultaneously link up to 4 props using 1 script, by adding all 4 PIDs in the Trigger Prop ID parameter, each separated by a semicolon( ; ).
The Reversed Trigger option does exactly what it sounds like... instead of starting on Enter and stopping on Exit, it causes the triggered script to do just the opposite. Lights go off when someone enters, and on when someone leaves.
The last 2 parameters are self-explanatory. If you want to trigger the script when someone enters the trigger box, you check the 'On Enter' parameter. If you want to trigger when someone leaves the trigger box, you would check the 'On Exit' parameter. You can choose one or the other, or both, depending on your situation and how you want it to work.
You do not need to set any special states for this script if you are using it on a Trigger Box prop. The Trigger state is set automatically for you when you choose the script.
However, if you want to use this script as a switch on a prop, you do need to uncheck the 'Trigger' state and check the 'Clickable Trigger' state.
When using this script as a clickable trigger, the 'Trigger on Enter' and 'Trigger on Exit' options do not apply.
-Vie
Thank you so much Viegoth LETS GO BRANDON LETS GO BRANDON
|
3 users thanked Dr_Sean_Davis for this useful post.
|
|