devianceone
Lua Scripter
- Joined
- Jan 24, 2009
- Messages
- 756
- Reaction score
- 29
Im using a script like the following to scan a multi floor room for players.
The problem is, both floors aren't completely tiled and using getThingfromPos on a tile that has nothing at all on it gives an error "Tile not found". Its searching hundreds of different tiles and it's causing the server to lag out because of the spam it creates in console.
The script works fine when only searching a completely tiled single floor, so how can i verify a tile exists on floors that are not fully tiled before using the function getThingfromPos on it to prevent any errors?
PHP:
for x = WaitingRoom.fromX, WaitingRoom.toX do
for y = WaitingRoom.fromY, WaitingRoom.toY do
for z = WaitingRoom.fromZ, WaitingRoom.toZ do
local PlayerCheck = getThingfromPos({x=x, y=y, z=z,stackpos = 253})
if isPlayer(PlayerCheck.uid) then
The problem is, both floors aren't completely tiled and using getThingfromPos on a tile that has nothing at all on it gives an error "Tile not found". Its searching hundreds of different tiles and it's causing the server to lag out because of the spam it creates in console.
The script works fine when only searching a completely tiled single floor, so how can i verify a tile exists on floors that are not fully tiled before using the function getThingfromPos on it to prevent any errors?