So:
Function + search for a random tile #1 location + teleport player.
Thanks
Scripts
FUNCTION - Teleport a player to a random tile.
FUNCTION - Teleport a player to a random tile.
1

local frames = {}
for frame = 0,map("tilecount") do
	frames[frame] = {}
end
for x = 0,map("xsize") do
	for y = 0,map("ysize") do
		table.insert(frames[tile(x,y,"frame")],{x,y})
	end
end
math.randomseed(os.time())
function teleportRandomTile(id,frame)
	if frames[frame] then
		if #frames[frame] > 0 then
			local x,y = unpack(frames[frame][math.random(#frames[frame])])
			parse("setpos "..id.." "..x*32+16 .." "..y*32+16)
		else
			error("no tiles with frame #"..frame,2)
		end
	else
		error("frame not found",2)
	end
end
Waldin: if u want we can script together
LUA ERROR: sys/lua/cs2dtibia/items.lua:245: frame not found -> [C]: in function 'error' -> sys/lua/cs2dtibia/items.lua:859: in function 'teleportRandomTile' -> sys/lua/cs2dtibia/items.lua:245: in function '?' -> sys/lua/cs2dtibia/hooks.lua:340: in function <sys/lua/cs2dtibia/hooks.lua:309> -> in Lua hook 'menu', params: 1, 1, 251, 0, 0, -99, 0
Waldin: @
Mami Tomoe: Using tibia script
teleportRandomTile(id,"1")
Waldin's script tries to index the parameter you pass - "1"teleportRandomTile(id,1)
Rainoth: @
Waldin:
1
