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

Lua "doPlayerAddExp" function.

Bam

Active Member
Joined
Aug 11, 2007
Messages
1,446
Reaction score
39
Location
Sweden
Code:
		doPlayerAddExp(cid,experience)

Doesnt seem to work in my 0.3.4 TFS. Anyone knows why?
 
You need a script to make it work.

Example: Exp Scroll/Ticket

LUA:
local exp = 500000

function onUse(cid, item, fromPos, itemEx, toPos)
    if getPlayerLevel(cid) >= 50 then
        doPlayerAddExp(cid, exp)
        doSendPlayerTextMessage(cid, 22, "You have gained ".. exp .." experience points.")
        doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
        doRemoveItem(item.uid)
    else
        doPlayerSendCancel(cid, "You must be atleast level 50 to use this.")
    end
end

Not Tested :thumbup:
 
Last edited:
Oh comeon I know that :p

It's just that the script works to remove the item but it wont give the exp. So I assume the problem is in the doPlayerAddExp.
 
I know the function works.
I don't know what the problem is.

Sorry, thought you were a noob, that could just write the addExp, and expect exp. :p
 
Back
Top