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

a lever that when you use it you get to level 8 always

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
hi, I have a good idea, when someone for example wants to make a quest in rook but he has to kill many things and gets to lvl 10 he kill himslef to get lvl 8 to go to main, so I have a idea for a script that when you use a lever if you are only more than level 8 you transform to level 8, but I dont know how to do that
for example a lvl 15: you are now level 8
lvl 13: you are now level 8
lvl 9: you are now level 8

I dont know how to do that if someone could help me in this script =)
rep++
 
levellever.lua
LUA:
function onUse(cid, item, frompos, topos)
	if item.uid == ENTER_YOUR_LEVER_UID_HERE then
		if getPlayerLevel(cid) >= 9 then
			setPlayerLevel(cid,8)
                        doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
		end
	end
	return TRUE
end
and in actions.xml
XML:
<action uniqueid="ENTER_YOUR_LEVER_UID_HERE" event="script" value="scripts/levellever.lua"/>
I haven't tested it :P
 
Last edited:
hey men thare is a problem in the script look when i use it...

[04/09/2010 19:41:30] [Error - Action Interface]
[04/09/2010 19:41:30] data/actions/scripts/quests/level8.lua:onUse
[04/09/2010 19:41:30] Description:
[04/09/2010 19:41:30] data/actions/scripts/quests/level8.lua:4: attempt to call global 'setPlayerLevel' (a nil value)
[04/09/2010 19:41:30] stack traceback:
[04/09/2010 19:41:30] data/actions/scripts/quests/level8.lua:4: in function <data/actions/scripts/quests/level8.lua:1>
 
Back
Top