yes using a dummy object and this script (press e to kill yourself just to show it works - remove the code after testing)
set always active = yes and copy the name of the entity into it's own 'ifused' field
random_player_spawn_location.lua
local dead = 0
--sets minimum and maximum values to be randomed in x,y,z of world (game world is currently 0 x 50000 with a starting y of 600)
local x1 = 1000
local x2 = 49000
local y1 = 800
local y2 = 1000
local z1 = 1000
local z2 = 49000
--set object always active = yes
--copy name of object into the 'ifused' field
function random_player_spawn_location_init(e)
CollisionOff(e)
Hide(e)
end
function random_player_spawn_location_main(e)
Hide(e)
--Prompt(g_PlayerPosX.." "..g_PlayerPosZ)
if g_PlayerHealth > 0 then
if dead == 0 then
CollisionOff(e)
SetPosition(e,g_PlayerPosX,g_PlayerPosY,g_PlayerPosZ)
else
TransportToIfUsed(e)
dead = 0
end
else
CollisionOff(e)
local x = math.random(x1,x2)
local y = math.random(y1,y2)
local z = math.random(z1,z2)
SetPosition(e,x,y,z)
CollisionOn(e)
dead = 1
PromptDuration(x.." "..y.." "..z,2500)
end
if GetScancode() == 18 then
HurtPlayer(e,g_PlayerHealth) --remove this code to stop e key from killing the player
end
end
function random_player_spawn_location_exit(e)
end
life\'s one big game
windows vista ultimate
i5 @3.3ghz, 4gb ram, AMD R9 200 series , directx 11