• 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!

Solved Vip door

xscas

New Member
Joined
Jan 1, 2010
Messages
46
Reaction score
0
This script:

Code:
local vipPosition = Position(101, 116, 7)

function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
local player = Player(cid)
if item.actionid == 1502 then
local position = player:getPosition()
if position.y < fromPosition.y then
fromPosition.y = fromPosition.y + 1
else
fromPosition.y = fromPosition.y - 1
end
player:teleportTo(fromPosition)
player:say('!* VIP *!', TALKTYPE_MONSTER_SAY)
fromPosition:sendMagicEffect(CONST_ME_STUN)

elseif item.actionid == 1503 then
local position = player:getPosition()
if position.x < fromPosition.x then
fromPosition.x = fromPosition.x + 1
else
fromPosition.x = fromPosition.x - 1
end
player:teleportTo(fromPosition)
player:say('!* VIP *!', TALKTYPE_MONSTER_SAY)
fromPosition:sendMagicEffect(CONST_ME_STUN)

elseif item.actionid == 1504 then
if player:isVip() then
player:teleportTo(vipPosition)
player:say('!* VIP *!', TALKTYPE_MONSTER_SAY)
vipPosition:sendMagicEffect(CONST_ME_STUN)
else


it goes through the door, I wanted the door open, is?

system = http://otland.net/threads/vip-system-the-forgotten-server-1-0.224910/#post-2170065

thank you
 
Last edited:
Which server do you use and which vip system, can you add a link to the vip system?
The scripts you posted are for different server versions.
 
Which server do you use and which vip system, can you add a link to the vip system?
The scripts you posted are for different server versions.
changed the system, but one of the questions still, the system is at the end of the topic
 
Are you using TFS 1.0?
In doors.lua, under
Code:
  elseif isInArray(levelDoors, item.itemid) then
     local player = Player(cid)
You can add
Code:
    if item.actionid == 502 then
         if player:isVip() then
             Item(item.uid):transform(item.itemid + 1)
             player:teleportTo(toPosition, true)
         else
             player:sendTextMessage(MESSAGE_INFO_DESCR, "Only vip players may pass.")
         end
     end
Then add actionid 502 to vip doors.
 
Are you using TFS 1.0?
In doors.lua, under
Code:
  elseif isInArray(levelDoors, item.itemid) then
     local player = Player(cid)
You can add
Code:
    if item.actionid == 502 then
         if player:isVip() then
             Item(item.uid):transform(item.itemid + 1)
             player:teleportTo(toPosition, true)
         else
             player:sendTextMessage(MESSAGE_INFO_DESCR, "Only vip players may pass.")
         end
     end
Then add actionid 502 to vip doors.

ERROR CONSOLE:
[Warning] - Event::checkScript] Can not load script: scripts/vipdoor.lua, data/actions/scripts/vipdoor.lua:12: 'end' expected <to close 'function' at line 3> near '<eof>'


Code:
local vipPosition = Position(581, 420, 7)

function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
    local player = Player(cid)
if item.actionid == 502 then
         if player:isVip() then
             Item(item.uid):transform(item.itemid + 1)
             player:teleportTo(toPosition, true)
         else
             player:sendTextMessage(MESSAGE_INFO_DESCR, "Only vip players may pass.")
         end
     end
 
In doors.lua, this is an existing script in data/actions/scripts/other, look for this
Code:
elseif isInArray(levelDoors, item.itemid) then
local player = Player(cid)
And add it under it, so don't create a new file.
 
In doors.lua, this is an existing script in data/actions/scripts/other, look for this
Code:
elseif isInArray(levelDoors, item.itemid) then
local player = Player(cid)
And add it under it, so don't create a new file.

did not work and not of any error


I test this script \/, but, did not work either :(
Code:
function onUse(cid, item, frompos, item2, topos)
if isVip(cid) == TRUE then
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"Stand in front of the door.")
return true
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'You need to be vip to pass.')
end
return true
end
 
Last edited:
If there are problems post how you added it, in the script and in the map and what happens, "did not work" is not a clear description of your problem or what should be different.
 
Sorry,

I add:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
    if isInArray(questDoors, item.itemid) then
        local player = Player(cid)
        if player:getStorageValue(item.actionid) ~= -1 then
            Item(item.uid):transform(item.itemid + 1)
            player:teleportTo(toPosition, true)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
        end
        return true

    elseif isInArray(levelDoors, item.itemid) then
        local player = Player(cid)
        if item.actionid == 502 then
         if player:isVip() then
             Item(item.uid):transform(item.itemid + 1)
             player:teleportTo(toPosition, true)
         else
             player:sendTextMessage(MESSAGE_INFO_DESCR, "Only vip players may pass.")
         end
     end
        if item.actionid > 0 and player:getLevel() >= item.actionid - 1000 then
            Item(item.uid):transform(item.itemid + 1)
            player:teleportTo(toPosition, true)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "Only the worthy may pass.")
        end
        return true

    elseif isInArray(keys, item.itemid) then
        if itemEx.actionid > 0 then
            if item.actionid == itemEx.actionid then
                if doors[itemEx.itemid] then
                    Item(itemEx.uid):transform(doors[itemEx.itemid])
                    return true
                end
            end
            Player(cid):sendTextMessage(MESSAGE_STATUS_SMALL, "The key does not match.")
            return true
        end
        return false
    end

    local tileToPos = toPosition:getTile()
    local thing = tileToPos:getThing(STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE)
    if thing and item.uid ~= thing:getUniqueId() and fromPosition:getTile():getItemByType(ITEM_TYPE_MAGICFIELD) then
        return false
    end

    if isInArray(horizontalOpenDoors, item.itemid) or isInArray(verticalOpenDoors, item.itemid) then
        local doorCreature = tileToPos:getTopCreature()
        if doorCreature ~= nil then
            toPosition.x = toPosition.x + 1
            local query = toPosition:getTile():queryAdd(doorCreature, 20)
            if query ~= RETURNVALUE_NOERROR then
                toPosition.x = toPosition.x - 1
                toPosition.y = toPosition.y + 1
                query = toPosition:getTile():queryAdd(doorCreature, 20)
            end

            if query ~= RETURNVALUE_NOERROR then
                Player(cid):sendTextMessage(MESSAGE_STATUS_SMALL, query)
                return true
            end

            doorCreature:teleportTo(toPosition, true)
        end
        if not isInArray(openSpecialDoors, item.itemid) then
            Item(item.uid):transform(item.itemid - 1)
        end
        return true
    end

    if doors[item.itemid] then
        if item.actionid == 0 then
            Item(item.uid):transform(doors[item.itemid])
        else
            Player(cid):sendTextMessage(MESSAGE_INFO_DESCR, "It is locked.")
        end
        return true
    end

    return false
end

sgHCc8.jpg
 
Back
Top