• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Universal Experience Scroll

How can you fix so you can only use it ONCE per character? Is that possible?

Thanks.
 
Code:
local t = {
	storage = 10000,
	exp = 100000
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, t.storage) < 1 then
		doPlayerAddExp(cid, 2500000)
		doSendAnimatedText(getThingPos(cid), t.exp, TEXTCOLOR_WHITE)
		doCreatureSay(cid, "You gained " .. t.exp .. " experience!", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
		setPlayerStorageValue(cid, t.storage, 1)
		doRemoveItem(item.uid, 1)
	else
		doCreatureSay(cid, "You can only use 1 scroll per character.", TALKTYPE_ORANGE_1, false, cid, getThingPos(cid))
	end
	return true
end
 
Can someone update this script so that I can 'Use on' it to some player and than it will add experience for specific player...
 
Can someone update this script so that I can 'Use on' it to some player and than it will add experience for specific player...

If an item doesn't start with "Use with..." then you can't add it without editing the otb file if I'm not mistaken. Correct me if I'm wrong.
 
Back
Top