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

Problem with my scrolls for the server, they are malfunctioning

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
507
Reaction score
68
Hello how are you Otland community, I have a problem with the scrolls for my server, for example, the scrolls of the Blessing, when I use it, it fulfills its function well, but I can use the scrolls two or three times. And that's wrong, I should only put the scrolls on once and the second time you want to put it on the notification that the blessings already have on. Do you understand?
bleesing scrolls:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 7553 then ---<  change
                doPlayerAddBlessing(cid, 1)
                doPlayerAddBlessing(cid, 2)
                doPlayerAddBlessing(cid, 3)
                doPlayerAddBlessing(cid, 4)
                doPlayerAddBlessing(cid, 5)
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)           
        doRemoveItem(item.uid, 1)
    end
return true
end
In the Green and Blue Scrolls it happens to me that I can use both on the same character, it shouldn't be like that, if you wear blue I shouldn't be able to wear green, if you wear green I shouldn't be able to wear blue. Do you understand?
17:05 You already have Green Djin Quest!
17:05 You already have Blue Djin Quest!
Green djin Scrolls:
Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
if(getPlayerStorageValue(cid, 51123) == 3) then
doPlayerSendTextMessage(cid, 22, "You already have Green Djin Quest!")
else
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, 51123, 3)
doPlayerSendTextMessage(cid, 22, "You just completed Green Djin Quest!")
end
else
doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
end
return true
end
Blue Djins Scrolls:
Lua:
function onUse(cid, item, itemEx, toPosition)
 
local pos = getCreaturePosition(cid)
if (getTilePzInfo(getPlayerPosition(cid)) == TRUE) then
if(getPlayerStorageValue(cid, 51114) == 3) then
doPlayerSendTextMessage(cid, 22, "You already have Blue Djin Quest!")
else
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, 51114, 3)
doPlayerSendTextMessage(cid, 22, "You just completed Blue Djin Quest!")
end
else
doPlayerSendTextMessage(cid, 22, "You can only use this item inside protection zone!")
end
return true
end

How can I fix this, in these 3 scrolls?
 
Solution

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
 
    if player then
        local pos = player:getPosition()
      
        if getTilePzInfo(pos) then
            if player:getStorageValue(51123) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Green Djin Quest!")
            else
                if player:getStorageValue(51114) == 3 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Blue Djin Quest!")
                else
                    item:remove(1)
                    player:setStorageValue(51123, 3)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just...
Open your mind: when posting on Otland next time, remember that no one can read your mind or know about your server through magical powers. It is important to inform about the version you are using, whether it's TFS or OTX, be it 0.4 or 1.5, and so on. Nobody possesses magical powers; therefore, make sure to provide information about the version of your TFS, etc.

I recommend you take a look at your server folder, specifically 'data/lib/compat/compat.lua,' read through it, and reflect on your thoughts. Afterwards, make the necessary changes for TFS 1.x. What you posted are scripts intended for TFS 0.3.6 or 0.4 before. You should review the functions that need to be converted/adapted to work properly for TFS 1.x. I hope this helps.

RealMap-Global-8.0-TFS1.2/data/lib/compat/compat.lua at main · Brunowots/RealMap-Global-8.0-TFS1.2 (https://github.com/Brunowots/RealMap-Global-8.0-TFS1.2/blob/main/data/lib/compat/compat.lua)


Anyway, I know you by your profile, so I know what you're using... I made changes, your scripts are here.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local bloodScrollID = 7553

    if item.itemid == bloodScrollID then
        if player then
            if not player:hasBlessing(1) then
                for i = 1, 5 do
                    player:addBlessing(i)
                end
                player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
                item:remove(1)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have this blessing.")
            end
        end
    end

    return true
end


Lua:
function onUse(cid, item, itemEx, toPosition)
    local player = Player(cid)
   
    if player then
        local pos = player:getPosition()
        if getTilePzInfo(pos) then
            if player:getStorageValue(51123) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have completed the Green Djin Quest!")
            else
                item:remove(1)
                player:setStorageValue(51123, 3)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed Green Djin Quest!")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
   
    return true
end


Lua:
function onUse(cid, item, itemEx, toPosition)
    local player = Player(cid)
   
    if player then
        local pos = player:getPosition()
       
        if getTilePzInfo(pos) then
            if player:getStorageValue(51114) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have completed the Blue Djin Quest!")
            else
                item:remove(1)
                player:setStorageValue(51114, 3)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed the Blue Djin Quest!")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
   
    return true
end
 
Last edited:
Open your mind: when posting on Otland next time, remember that no one can read your mind or know about your server through magical powers. It is important to inform about the version you are using, whether it's TFS or OTX, be it 0.4 or 1.5, and so on. Nobody possesses magical powers; therefore, make sure to provide information about the version of your TFS, etc.

I recommend you take a look at your server folder, specifically 'data/lib/compat/compat.lua,' read through it, and reflect on your thoughts. Afterwards, make the necessary changes for TFS 1.x. What you posted are scripts intended for TFS 0.3.6 or 0.4 before. You should review the functions that need to be converted/adapted to work properly for TFS 1.x. I hope this helps.

RealMap-Global-8.0-TFS1.2/data/lib/compat/compat.lua at main · Brunowots/RealMap-Global-8.0-TFS1.2 (https://github.com/Brunowots/RealMap-Global-8.0-TFS1.2/blob/main/data/lib/compat/compat.lua)


Anyway, I know you by your profile, so I know what you're using... I made changes, your scripts are here.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local bloodScrollID = 7553

    if item.itemid == bloodScrollID then
        if player then
            if not player:hasBlessing(1) then
                for i = 1, 5 do
                    player:addBlessing(i)
                end
                player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
                item:remove(1)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have this blessing.")
            end
        end
    end

    return true
end


Lua:
function onUse(cid, item, itemEx, toPosition)
    local player = Player(cid)
  
    if player then
        local pos = player:getPosition()
        if getTilePzInfo(pos) then
            if player:getStorageValue(51123) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have completed the Green Djin Quest!")
            else
                item:remove(1)
                player:setStorageValue(51123, 3)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed Green Djin Quest!")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
  
    return true
end


Lua:
function onUse(cid, item, itemEx, toPosition)
    local player = Player(cid)
  
    if player then
        local pos = player:getPosition()
      
        if getTilePzInfo(pos) then
            if player:getStorageValue(51114) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have completed the Blue Djin Quest!")
            else
                item:remove(1)
                player:setStorageValue(51114, 3)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed the Blue Djin Quest!")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
  
    return true
end
Thank you, it's true what you say, for the next post I'm going to keep it in mind to put more information.. Now I test the scrolls
 
Open your mind: when posting on Otland next time, remember that no one can read your mind or know about your server through magical powers. It is important to inform about the version you are using, whether it's TFS or OTX, be it 0.4 or 1.5, and so on. Nobody possesses magical powers; therefore, make sure to provide information about the version of your TFS, etc.

I recommend you take a look at your server folder, specifically 'data/lib/compat/compat.lua,' read through it, and reflect on your thoughts. Afterwards, make the necessary changes for TFS 1.x. What you posted are scripts intended for TFS 0.3.6 or 0.4 before. You should review the functions that need to be converted/adapted to work properly for TFS 1.x. I hope this helps.

RealMap-Global-8.0-TFS1.2/data/lib/compat/compat.lua at main · Brunowots/RealMap-Global-8.0-TFS1.2 (https://github.com/Brunowots/RealMap-Global-8.0-TFS1.2/blob/main/data/lib/compat/compat.lua)


Anyway, I know you by your profile, so I know what you're using... I made changes, your scripts are here.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
    local bloodScrollID = 7553

    if item.itemid == bloodScrollID then
        if player then
            if not player:hasBlessing(1) then
                for i = 1, 5 do
                    player:addBlessing(i)
                end
                player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
                item:remove(1)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have this blessing.")
            end
        end
    end

    return true
end


Lua:
function onUse(cid, item, itemEx, toPosition)
    local player = Player(cid)
  
    if player then
        local pos = player:getPosition()
        if getTilePzInfo(pos) then
            if player:getStorageValue(51123) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have completed the Green Djin Quest!")
            else
                item:remove(1)
                player:setStorageValue(51123, 3)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed Green Djin Quest!")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
  
    return true
end


Lua:
function onUse(cid, item, itemEx, toPosition)
    local player = Player(cid)
  
    if player then
        local pos = player:getPosition()
      
        if getTilePzInfo(pos) then
            if player:getStorageValue(51114) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have completed the Blue Djin Quest!")
            else
                item:remove(1)
                player:setStorageValue(51114, 3)
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed the Blue Djin Quest!")
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
  
    return true
end
19:17 You already have completed the Blue Djin Quest!
19:17 You already have completed the Green Djin Quest!
DJ scrolls continue to cause problems... you can use both, not just one... why would that be?
 

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
 
    if player then
        local pos = player:getPosition()
      
        if getTilePzInfo(pos) then
            if player:getStorageValue(51123) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Green Djin Quest!")
            else
                if player:getStorageValue(51114) == 3 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Blue Djin Quest!")
                else
                    item:remove(1)
                    player:setStorageValue(51123, 3)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed the Green Djin Quest!")
                end
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
 
    return true
end


Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
 
    if player then
        local pos = player:getPosition()
      
        if getTilePzInfo(pos) then
            if player:getStorageValue(51114) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Blue Djin Quest!")
            else
                if player:getStorageValue(51123) == 3 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Green Djin Quest!")
                else
                    item:remove(1)
                    player:setStorageValue(51114, 3)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed the Blue Djin Quest!")
                end
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
 
    return true
end
 
Solution

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
 
    if player then
        local pos = player:getPosition()
     
        if getTilePzInfo(pos) then
            if player:getStorageValue(51123) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Green Djin Quest!")
            else
                if player:getStorageValue(51114) == 3 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Blue Djin Quest!")
                else
                    item:remove(1)
                    player:setStorageValue(51123, 3)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed the Green Djin Quest!")
                end
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
 
    return true
end


Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local player = Player(cid)
 
    if player then
        local pos = player:getPosition()
     
        if getTilePzInfo(pos) then
            if player:getStorageValue(51114) == 3 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Blue Djin Quest!")
            else
                if player:getStorageValue(51123) == 3 then
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed the Green Djin Quest!")
                else
                    item:remove(1)
                    player:setStorageValue(51114, 3)
                    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have just completed the Blue Djin Quest!")
                end
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use this item inside a protection zone!")
        end
    end
 
    return true
end
Thank you very much, this helped me and it was perfect
 
Back
Top