mp.keys.bind(global.Keys.VK_Q, true, function () {
if (--selecttestfsd < 0)
{
selecttestfsd = 0;
return;
}
if (objdata && mp.objects.exists(objdata))
{
objdata.destroy();
return;
}
const zcoord = mp.game.gameplay.getGroundZFor3dCoord(objdatap.x, objdatap.y, objdatap.z + 50, 0, false);
objdatap.z = zcoord;
objdata = mp.objects.new(testfsd[selecttestfsd], objdatap, {
'rotation': new mp.Vector3(0, 0, objdatar),
'dimension': global.localplayer.dimension
});
objdata.placeOnGroundProperly();
objdatap = objdata.getCoords(true);
objectEditor.entity.position = new mp.Vector3(objdatap.x, objdatap.y, objdatap.z);
});