Jump to content
Sign in to follow this  

Empty Vehicle Teleporting (Activated By Trigger)

Recommended Posts

Hey all, Need some help with a script that I have been working on. I need a script which will allow me to move an empty unnamed vehicle to an elevated height without any player inside of it. I am getting errors with this script which I am using:

Trigger Cond:

this && ("Car" countType thislist > 0)

Trigger Act:

_dump = [(thislist select 0), ThisTrigger] execVM "PRP\sheriffCarTP.sqf";



_spawn = getMarkerPos "sheriff_car_spawn";
_veh = nearestObjects [_spawn, ["Car"], 10];
_hs = getMarkerPos "sheriff_car_elevated";

_veh allowdamage false;
_veh setPos _hs;
sleep 0.05;
_veh setPosATL (_veh modelToWorld [0,0,3]);
sleep 1;
_veh allowdamage true;

The error we are getting is to do with the allowdamage statement and even if I remove that statement we still get an error with the code...

Any ideas ??

Share this post

Link to post
Share on other sites

It's always a good idea to show us the actual error you're getting (screenshot ideally).


Also helps to know what the script is used for (allows us to potentially provide alternative solutions)





Some parts of your script seem a bit weird to me:

- You pass parameters to your script, but you never use them

- setPos followed directly by a setPosATL why?




Anyway, I assume the following:

- Your trigger is a radiotrigger?

- You have several vehicles inside the trigger area (probably respawning there) and each time the trigger is activated you want one of them to get teleported to the specified marker?



So try this:


Cond ->

keep as is


Act ->

_dump = [thisTrigger] execVM "PRP\sheriffCarTP.sqf";

Script ->

params ["_trigger"];
private ["_cars","_car","_hs"];

_cars = (list _trigger) select {_x isKindOf "Car"};
if ((count _cars) isEqualTo 0) exitWith {};

_car = _cars select 0;
_car allowdamage false;
_hs = getMarkerPos "sheriff_car_elevated";
_car setPosATL (_hs vectorAdd [0,0,3]);
sleep 1;
_car allowdamage true;

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this