• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Random Teleport ( Gameobject )

Rochet2

Moderator / Eluna Dev
You could enhance the script with lua tables :)
it would make less repetitive code and easy location editing and adding and removing.

? Also faster as it works as a jump table?
 

Foereaper

Founder
You could do something like this, using tables :) Untested but should work fine

Code:
local objectid = objectentryhere

local Table = {
	{map, x, y, z, o},
	{map, x, y, z, o},
	};

function PortalTrigger(event, plr, intid)
	local chance = math.random(1, #Table)
	
	plr:Teleport(Table[chance][1], Table[chance][2], Table[chance][3], Table[chance][4], Table[chance][5])   
	plr:SetPvP(true)
end

RegisterGameObjectGossipEvent(objectid, 1, PortalTrigger)
 
Top