Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Light switch help

Author
Message
ravenvince2
11
Years of Service
User Offline
Joined: 13th Jan 2013
Location:
Posted: 22nd Apr 2013 23:14
Hello I'm working in a game and having trouble with scripting. I'm still some what new at scripting but here's what I want to do. I have a remote locked door with a flashing red light near it. I want someone to hit the switch to open the door and the light will turn green.

And help I'd love thank you. here's my script.

;Artificial Intelligence Script

;Header

desc =Light turn on and off

;Trigger

:state=0:lightoff,timerstart,state=1
:state=1,timergreater=250:state=2
:state=2:lighton,timerstart,state=3
:state=3,timergreater=200:state=4
:state=4:activateifused=0,lightoff,state=5
:state=5:activateifused=1,lighton,lightred=0,lightgreen=255=lightblue=0

;End of Script
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 25th Apr 2013 17:12
Hi ravenvince2
It's not too hard, and your on the right track with your script. Just a few changes. Remember to use "etimer" not "timer" as it works better with entities when running multiple scripts.
First setup your door and remote switch as normal. Then for your light make sure it's dynamic (red light of course) and attach this to its Main script.

Note the "etimergreater" (500=half sec. change to your needs)
Also "plrdistwithin=200(two segments,change to your need).Place the light and switch close to door. Tested & works.
best

Login to post a reply

Server time is: 2024-11-23 14:23:18
Your offset time is: 2024-11-23 14:23:18