Author Topic: Scripting Help  (Read 932 times)

Is there any way to make a door or gate that opens only when several switches are activated?

First off, it's eventing, not scripting. Anyways, I would use VCE for something like this but it could probably be done with default events.

yeah it can be done with default events if you use make it so every switch makes a counter go down by one
and when the counter goes below 0 then the door opens

yeah it can be done with default events if you use make it so every switch makes a counter go down by one
and when the counter goes below 0 then the door opens
Could you possibly show me an example? All of my efforts to try this have been unsuccessful.

Could you possibly show me an example? All of my efforts to try this have been unsuccessful.
sure

switch events
ontrigger>namedbrick(counter)>decrimentprintcount[1]
offtrigger>namedbrick(counter)>incrimentprintcount[1]

named brick (counter), set to initially have 1 less than the count of switches (6 switches -> counter starts at 5)
onprintcounterunderflow>opendoor
onprintcounteroverflow>closedoor

Is there any way to only make the switches open the door the first time they are activated? (To avoid one switch pressed multiple times that opens the door)

Is there any way to only make the switches open the door the first time they are activated? (To avoid one switch pressed multiple times that opens the door)
make the switches disappear whenever a player activates them
then they can't click on it again

switch events
ontrigger>namedbrick(counter)>decrimentprintcount[1]
offtrigger>namedbrick(counter)>incrimentprintcount[1]

named brick (counter), set to initially have 1 less than the count of switches (6 switches -> counter starts at 5)
onprintcounterunderflow>opendoor
onprintcounteroverflow>closedoor
I don't have the events "ontrigger" or "offtrigger". Would toggle_event_enabled work just as well?

if you have VCE, event each button with this:
onvariablefalse>self>vce_modvariable>client buttonspressed add 1
onvariablefalse>self>vce_modvariable>brick ispressed set 1
onvariabletrue>client>chatmessage>"you have already clicked this!"
then on the door, event it:
onactivate>self>vce_ifvalue>client buttonpressed  == 3
onvariabletrue>self>door>toggle

Is there any way to only make the switches open the door the first time they are activated? (To avoid one switch pressed multiple times that opens the door)
use my example, if a switch is turned off, the door will close/not open
all of the switches must be on for it to open
I don't have the events "ontrigger" or "offtrigger". Would toggle_event_enabled work just as well?
ontrigger/offtrigger are to be replaced with your "on"/"off" trigger like onactivate/onplayertouch/whatever

onactivate>namedbrick>decrimentprintcount
onactivate>namedbrick>incrimentprintcount
onactivate>self>toggleeventsenabled
would also work, the first is the on trigger, the second is the off trigger