yonose 12 Posted December 6, 2017 I want to let the players to teleport to each location by scrolling on a flagpole and choose his destination. MP mission a dedicated server, testing in the editor. Im getting: Error getpos: Type string, expected Object, Location (last line is getting the error) // Get the destination. _dest = (_this select 3) select 0; // Get a random direction _dir = random 359; // Move the person a few meters away from the destination (in the direction of _dir) player SetPos [(getPos _dest select 0)-10*sin(_dir),(getPos _dest select 1)-10*cos(_dir)]; Im calling the script using: this addAction ["<t color='#3751d0'>Base</t>","script\teleport.sqf",["tp_base"]]; this addAction ["<t color='#669c3c'>Infantry - Basic</t>","script\teleport.sqf",["tp_infbas"]]; this addAction ["<t color='#f0a71b'>Shootingrange</t>","script\teleport.sqf",["tp_shootingrange"]]; Share this post Link to post Share on other sites
Grumpy Old Man 3540 Posted December 6, 2017 This select 3 is the params array passed to the script executed by the addAction command. First parameter (select 0) is a string. Hence _dest is a string. Cheers Share this post Link to post Share on other sites
yonose 12 Posted December 6, 2017 I tried "_dest = _this select 3;" instead, but it didnt work, now im getting "Error getpos: Type Array, expected Object, Location" instead. Share this post Link to post Share on other sites
pierremgi 4739 Posted December 6, 2017 Keep: _dest = _this select 3 select 0; and, as you're playing with markers: player setPos [(getMarkerPos _dest select 0)-10*sin(_dir),(getMarkerPos _dest select 1)-10*cos(_dir),0]; 1 1 Share this post Link to post Share on other sites
yonose 12 Posted December 7, 2017 Okey.. I thought if i used getPos instead of getMarkerPos, it would use the flagpole position instead of the marker. So i renamed the markers to the same variable name, it works now. Thank you both. 1 Share this post Link to post Share on other sites