Jump to content
Sign in to follow this  
KingoftheSandbox

Teleport whole all players via foreach playableunits

Recommended Posts

// Get the destination.
_dest = getMarkerPos "cutstart";

// Get a random direction
_dir = random 359;

{_x SetPos [(getMarkerPos _dest select 0)-1*sin(_dir),(getMarkerPos _dest select 1)-1*cos(_dir)]} forEach playableUnits;

why is this not working? not SP, not MP...

calling script via null=execVM "script.sqf";

they need to stand together, but of course not bunched up

_dest is already a position, not a marker, so you do getMarkerPos _dest select 0 but you only need _dest select 0, and so on for the next one. Also, not sure if setPos accept position with only 2 variables? is it? if not, try adding a third one with a select 2

one last, maybe you wanted to have a random dir for every player, if that is the case, you should put it inside the foreach code

Edited by holo89

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  

×