• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua is there a function

Singed

New Member
Joined
Apr 20, 2009
Messages
112
Solutions
1
Reaction score
2
To check for the type of tile a person is standing on?

for example if you are standing on a pztile, or a pvp tile, or a non pvp tile

i'm sure there is, but if there isn't how would you script it?

:ninja:
 
Lua:
getTileInfo(getThingPos(cid))
returns table which looks like this:
Lua:
{protection = false, optional = false, nologout = false, hardcore = false, refresh = false, trashed = false, house = false, bed = false, depot = false, things = 0, creatures = 0, items = 0, topItems = 0, downItems = 0}
 
mm, so if i wanted the pvp script to only work on regular pvp tiles
what should i put?

i'm not sure i'm getting the table thing
 
TFS 0.3.5

and i mean when you are in the map editor you choose pvp tile so that when people die they get tped to temple instead of dying
 
kk, so just to ratify, if i want it to not work when they are in the pvp arena i would say

if not getTileInfo(getThingPos(cid)).pvp then

Correct?
 
So what if i want them to only gain lvls if they are in a normal pvp zone, like if they are in the arena they won't gain lvl, and if they are in pz they won't gain lvl either?
 
Code:
if getTileInfo(getThingPos(cid)).pvp then

Thanks for that! It helped alot. It wasnt working at first because my compat.lib was missing the pvp flag. so I added these lines to my compat getTileInfo function:

Code:
    ret.pvp = t:hasFlag(TILESTATE_PVPZONE)
    ret.nopvp = t:hasFlag(TILESTATE_NOPVPZONE)

i added nopvp check just in case.
With that, getTileInfo(pos).pvp works fine, and can also check no-pvp
 
Back
Top