Danger II
tibiara.com
Here are the coordinates for the teleport:
Okay now the problem is players will be teleported also into walls, trees, etc.
I have added getTileInfo(pos).blocksolid to my source but not really sure how to fix this part:
Anyone knows how to fix this part?
It doesnt check for blocksolids here:
local p = {x = math.random(t.from.x, t.to.x), y = math.random(t.from.y, t.to.y), z = math.random(t.from.z, t.to.z)}
Is there a way to let the script check it?
Code:
from = {x = XX, y = YY, z = ZZ}, -- Top left cornor of the playground (random players teleportation)
to = {x = XX, y = YY, z = ZZ}, -- Bottom right cornor of the playground (random players teleportation)
Okay now the problem is players will be teleported also into walls, trees, etc.
I have added getTileInfo(pos).blocksolid to my source but not really sure how to fix this part:
Code:
if #players >= t.minPlayers then
for i = 1, #players do
local p = {x = math.random(t.from.x, t.to.x), y = math.random(t.from.y, t.to.y), z = math.random(t.from.z, t.to.z)}
doTeleportThing(players[i], p)
doSendMagicEffect(p, CONST_ME_TELEPORT)
doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The battle begins. Survive for glory!")
end
else
for i = 1, #players do
doTeleportThing(players[i], {x=876, y=1025, z=7})
local mplayer = getPlayerMasterPos(players[i])
doTeleportThing(players[i], mplayer)
doPlayerSendTextMessage(players[i], MESSAGE_STATUS_WARNING, "The event didn't start because there isn't enough players in area!")
end
end
Anyone knows how to fix this part?
It doesnt check for blocksolids here:
local p = {x = math.random(t.from.x, t.to.x), y = math.random(t.from.y, t.to.y), z = math.random(t.from.z, t.to.z)}
Is there a way to let the script check it?