Apoccalypse
New Member
- Joined
- Apr 15, 2017
- Messages
- 114
- Solutions
- 2
- Reaction score
- 4
Hello,
I have very saphisticated problem with my amulet of experience's script.
Presently it changes its apperance from item id x to y as i wanted ,doubles gaining exp when it is set up and it makes experience back to normal when it is removed.
The problem is that it is infinite.
I would like it to disappears from the inventory (necklaces place) after one hour of using.
I started by declaring in local confing -- time = 1 and storage=20011 (i guess it is necklaces place) but I have no idea what could I do next to make it working.
If anyone could help that would be great
I have very saphisticated problem with my amulet of experience's script.
local config = {
rate = 2.0, -- 2.0 = 2x faster than normal.
un_equip = 2131, -- Item ID of the UN-Equipped ring.
equip = 2130, -- Item ID of the Equipped ring.
time = 1,
storage = 20011
}
function onDeEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, 1.0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
doTransformItem(item.uid, config.un_equip)
return true
end
function onEquip(cid, item, slot)
if getConfigValue("experienceStages") == "yes" then
doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)
else
doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate is now " .. config.rate .. "x doubled your former experience rate.It will last for ".. config.time .." hours.")
setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 1000)
doTransformItem(item.uid, config.equip)
doDecayItem(item.uid)
return true
end
rate = 2.0, -- 2.0 = 2x faster than normal.
un_equip = 2131, -- Item ID of the UN-Equipped ring.
equip = 2130, -- Item ID of the Equipped ring.
time = 1,
storage = 20011
}
function onDeEquip(cid, item, slot)
doPlayerSetExperienceRate(cid, 1.0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
doTransformItem(item.uid, config.un_equip)
return true
end
function onEquip(cid, item, slot)
if getConfigValue("experienceStages") == "yes" then
doPlayerSetExperienceRate(cid, getExperienceStage(getPlayerLevel(cid))*2)
else
doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*2)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate is now " .. config.rate .. "x doubled your former experience rate.It will last for ".. config.time .." hours.")
setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600 * 1000)
doTransformItem(item.uid, config.equip)
doDecayItem(item.uid)
return true
end
Presently it changes its apperance from item id x to y as i wanted ,doubles gaining exp when it is set up and it makes experience back to normal when it is removed.
The problem is that it is infinite.
I would like it to disappears from the inventory (necklaces place) after one hour of using.
I started by declaring in local confing -- time = 1 and storage=20011 (i guess it is necklaces place) but I have no idea what could I do next to make it working.
If anyone could help that would be great
