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 / When the player passes by a character he shoots him

Author
Message
Klax
17
Years of Service
User Offline
Joined: 14th Aug 2007
Location:
Posted: 13th Aug 2008 16:04
Im looking for a script, for a restricted area with security. So when a player passes by the guard, he shoots him. But if he doesnt walks through them, nothing happens.
Possible?
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 13th Aug 2008 16:09
Sure. Just use the PLRDISTWITHIN condition to tell the character to SHOOTPLR when he is within your desired distance.

Best.

Klax
17
Years of Service
User Offline
Joined: 14th Aug 2007
Location:
Posted: 13th Aug 2008 16:37
Can you show me a script of that?
I cant script.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 13th Aug 2008 16:51
Well, a very simple example would be:

Quote: "
;Artificial Intelligence Script

;Header

desc = Guard something

;Triggers

:random=20:rotateheadrandom=65
:shotdamage=1:shootplr
:plrdistwithin=200:shootplr

;End of Script
"


With this script, the guard would stand still and look around until he's shot at or the player gets too close. (200 units)

This would be the characters main AI script. Be sure to assign a him a Shoot script too, so that it will take over when one of the conditions is triggered.

Best.

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 14th Aug 2008 16:12
Your Welcome!

Klax
17
Years of Service
User Offline
Joined: 14th Aug 2007
Location:
Posted: 14th Aug 2008 16:38
Hey it worked thanks.
I have to place the security guard turned back, because if i get too near of him, he will shoot me, not when i pass by, but when i get close.

Thank you anway!
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 14th Aug 2008 17:57
I don't know what your level looks like so it's hard to tell you, but if the player needs to get closer to the guard before he reacts then just change the plrdistwithin=200:shootplr to a lower number like 100.

Best.

Hybrid
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: In the p-block, group 7.
Posted: 16th Aug 2008 18:52
Simple, but usefull. Nice script.

Login to post a reply

Server time is: 2024-11-24 11:50:08
Your offset time is: 2024-11-24 11:50:08