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

Xp Statue?

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Can some give me script so when you press on a item a statue or wall you get some xp .. only one time per player
 
Lua:
local key, exp = 1, 100000

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureStorage(cid, key) == -1 then
		doCreatureSetStorage(cid, key, 1)
		doPlayerAddExp(cid, exp)
		doSendAnimatedText(getThingPos(cid), exp, TEXTCOLOR_WHITE)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have received ' .. exp .. ' experience.')
	else
		doPlayerSendCancel(cid, 'You have already been rewarded.')
	end
	return true
end
 
Fuu.png


Cyko you were faster :(
 
Cyko, I didn't know this function:
Lua:
doCreatureSetStorage(cid, key, 1)

Always used this:
Lua:
setPlayerStorageValue(uid, valueid, newvalue)

So...it's good to know about it, thanks :p
 
itemid goes in actions.xml only :p stop thinking it should be in the lua script, that's a thing of the past
 
Back
Top