• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

What's wrong with this script?

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Hello. I am doing arenas, and instead of having weapons as rewards, I want to make two statues... one of them giving 500 levels and the other statue will give 5 skills (depending on the vocation) but something is wrong;

data/actions/scripts/arenareward.lua
PHP:
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= 5000 and getPlayerLevel(cid) <= 5001 then
        doPlayerAddExp(cid, getExperienceForLevel(getPlayerLevel(cid)+500)-(getPlayerExperience(cid)))
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
        doPlayerSendTextMessage(cid, 22, "You recieved 500 levels!")
        doRemoveItem(item.uid,1)
        doCreatureSay(cid, "You have gained 500 levels and have now reached level ".. getPlayerLevel(cid) .."! Relog to save your character", TALKTYPE_ORANGE_1)
    else
        doSendCancel(cid "Only players above level 5000 or below level 5001 can receive this arenareward.")
    end
end

actions.xml:
PHP:
<action uniqueid="42361" event="script" value="quests/arenareward.lua"/>

And I've made the statue's unique ID 42361...
 
LUA:
        doPlayerAddExp(cid, getExperienceForLevel(getPlayerLevel(cid)+500)-(getPlayerExperience(cid)))

to

LUA:
        doPlayerAddExp(cid, getExperienceForLevel(getPlayerLevel(cid)+500)-getPlayerExperience(cid))
 
I wouldn't say that, its going to depend on the server rate
What's the point of getting 500 levels if killin 3-4 monsters = 500 levels and train 2-3 hours for 5 skills? Its hard to say
 
Hmm try this one

i think this one may work i've changed somethings reply if it doesnt work

PHP:
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= 5000 and getPlayerLevel(cid) <= 5001 then
        doPlayerAddExp(cid, getExperienceForLevel(getPlayerLevel(cid)+500)-(getPlayerExperience(cid))
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
        doCreatureSay(cid, "You have gained 500 levels and have now reached level ".. getPlayerLevel(cid) .."! Relog to save your character", TALKTYPE_ORANGE_1)
		return doRemoveItem(item.uid)
    else
        doSendCancel(cid "Only players above level 5000 or below level 5001 can receive this arenareward.")
    end
end
 
But will that solve the problem? I mean, I am using an EXP scroll... I copied my exp scroll script (which is working perfectly) and added it to my statue script...


can't anyone of u make a script for me?
 
Back
Top