Lopaskurwa
Active Member
- Joined
- Oct 6, 2017
- Messages
- 873
- Solutions
- 2
- Reaction score
- 49
Hi so i made my second script which is on action so im having hard time with applying lvl requirement with action script, didnt had problems with npc's but now somehow i cant figure it out
So i came with something like this
So i came with something like this
Lua:
local config = {
minLevel = 250,
destination = { x = 76, y = 129, z = 7 },
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local player = Player(cid)
if player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are not able to use teleport while in combat!")
return false
end
doTeleportThing(cid, config.destination)
if config.minLevel and config.minLevel > 0 and player:getLevel() < config.minLevel then
-- not sure about this part because sendTextMessage do not support %s if im not wrong or im doing something wrong
end
return true
end