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

Exp Ring Problem !

Daniel Kopeć

Member
Joined
Dec 8, 2018
Messages
125
Solutions
4
Reaction score
12
Location
Poland
After putting on the ring, you don't get any experience at all.
After removing the ring, the server shuts down (crash). After about 2 minutes.
The time of the ring's goes down once and then it does not go down.

Here are my scripts:

XML:
<!-- Exp Ring -->
    <movevent type="Equip" itemid="7697" slot="ring" event="script" value="exp_ring.lua"/>
    <movevent type="Equip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/>
    <movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/>



Lua:
local config = {

rate = 1.5, -- 1.2 =  faster than normal.
un_equip = 7697, -- Item ID of the UN-Equipped ring.
equip = 7708 -- Item ID of the Equipped ring.

}

function onDeEquip(cid, item, slot)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
    doTransformItem(item.uid, config.un_equip)
    if getConfigValue("experienceStages") == "yes" then
        doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid)))
    else
        doPlayerSetExperienceRate(cid, getConfigValue("rateExperience"))
    end
    --print("printed onDeEquip")
    return true
end

function onEquip(cid, item, slot)
    if getConfigValue("experienceStages") == "yes" then
        doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*1.2)
    else
        doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*1.2)
    end
    --print("printed onEquip")
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now doubled your former experience rate.")
    doTransformItem(item.uid, config.equip)
    return true
end


I was looking for a solution on the forum but I found nothing sensible :(
Post automatically merged:

I've also used this script before

Lua:
local config = {
    rate = 2.0
}

function onDeEquip(cid, item, slot)
    if(item.itemid == 7697) then
        doPlayerSetExperienceRate(cid, 1.0)
           doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
            doTransformItem(item.uid, 7708)
    end
end

function onEquip(cid, item, slot)
    if(item.itemid == 7708) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.")
           doPlayerSetExperienceRate(cid, config.rate)
            doTransformItem(item.uid, 7697)
                return true
    end
end
Post automatically merged:

BUMP
 
Last edited:

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,803
Solutions
431
Reaction score
3,935
items.xml should handle the equip and unequip transforming for you.. so you shouldn't do that manually.
My guess is that you transform the item, and then the server tries to transform a second time, and is what is crashing the server.

And this might be helpful as well.

The no experience thing..
Try printing getExperienceStage(getPlayerLevel(cid)) and see if it's actually getting a value or not.
 

ROKI721

Active Member
Joined
Mar 12, 2011
Messages
160
Solutions
5
Reaction score
43
Location
Poland
Man, why u have:
Code:
<movevent type="Equip" itemid="7697" slot="ring" event="script" value="exp_ring.lua"/>
    <movevent type="Equip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/>
    <movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/>
if you have on script
Lua:
rate = 1.5, -- 1.2 =  faster than normal.
un_equip = 7697, -- Item ID of the UN-Equipped ring.  //DeEquip
equip = 7708 -- Item ID of the Equipped ring.  //Equip

You have equiped ring but not equiped this ring on yourself.
Can u test it?
Code:
<movevent type="Equip" itemid="7697" slot="ring" event="script" value="exp_ring.lua"/>
<movevent type="DeEquip" itemid="7708" slot="ring" event="script" value="exp_ring.lua"/>

Code:
rate = 1.5, -- 1.2 =  faster than normal.
un_equip = 7697, -- Item ID of the UN-Equipped ring.  //DeEquip
equip = 7708 -- Item ID of the Equipped ring.  //Equip

and add to items.xml
Find ID 7697 and add:
Code:
<attribute key="transformEquipTo" value="7708" />
then if you equip ring (id 7697 - un_equip) is transform to item (7708 - equip).
 
Top