Jump to content

Teleport back from restriction zone.


SadBoy1981

Recommended Posts

I have side zones where enemy cant walk or fly inside.

After few seconds they have been teleporting to salt lake, or other config, they die after 5 seconds.

My question is, how to make teleporting back for 10m  only?

 

This is part of code what i use to teleport enemies to salt lake but i want teleport them only 10m back

	}forEach rects;
	if ( _flag && alive player ) then {
		titleText [format ["Go away, restriction zone, teleport after ---> %1 <<<---",_timer],"PLAIN",0];//Warning for other players
		_timer = _timer - 1;
	}else{
		_timer = 5;
	};
	if ( _timer == -1 ) then {
		player setpos [23671.1, 18626.1, 0.3]; //salt lake
		titleText ["","PLAIN",0];
	};
Link to comment
Share on other sites

  • 1 month later...

I am looking for a way to restrict access to player bases based on UID, is this possible or adaptable from your script?

 

So this means that if I make a base, I cant have others come to visit (even if I asked them) without them getting teleported away?

Link to comment
Share on other sites

Found answer from crafting code.

_spawnPos = player modelToWorld [0,-50,0];
(vehicle player) setPosATL _spawnPos;

This small code just spawn back players to 50m when they come into private base.

 

Full code

if ((getPlayerUID player) in ["11111" ,"11111" ,"11111" ,"11111" ,"11111" ,"11111" ,"11111" , "11111"]) exitWith { 
titleText [format ["%1 Welcome back to your base! ", name player], "PLAIN DOWN"]; 
};
_spawnPos = player modelToWorld [0,-50,0];
(vehicle player) setPosATL _spawnPos; 
		titleText ["","PLAIN",0];
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...