• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Locker on Pz zone.

Il Knight

Veteran OT User
Joined
Dec 1, 2014
Messages
678
Solutions
7
Reaction score
352
Location
Spain
Hi otland!
today im trying to do this=
Players can only open the Locker on Protection Zone.
The Locker contain the Depot, Inbox, and Market.

16bkdut.jpg

can be done via LUA? function on use?
or need to edit the player.cpp?
 
Solved

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    
if player:getTile():hasFlag(TILESTATE_PROTECTIONZONE) then
return false
else
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "The shop can be only used on safe places.")
return true
end
    return true
end

used on locker.
 
Back
Top