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

Simple Modify to easy script

Saints Anathema

Old School Doleran
Joined
Feb 24, 2009
Messages
653
Reaction score
8
Location
BC,Canada
its a simple super brain on my server, gives a 2nd promotion i just wanted to make it so you had to be level 500 to use it

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerPromotionLevel(cid) == 0) then
		doPlayerSetPromotionLevel(cid, 1)
		doCreatureSay(cid, "You are now a Super Promoted!", TALKTYPE_MONSTER)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
	end
end

i tried adding it by ripping another script apart but it was a epic fail at life...

rep+ to either any help in writing myself or any positive posts
 
Solution
Hm, I think this will work.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerLevel(cid) >= 500 then
		if getPlayerPromotionLevel(cid) == 1 then
			doPlayerSetPromotionLevel(cid, 2)
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
			doCreatureSay(cid, "You have been promoted!", TALKTYPE_MONSTER_SAY)
		else
			doPlayerSendCancel(cid, "Sorry, not possible.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	
	return true
end
Hm, I think this will work.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerLevel(cid) >= 500 then
		if getPlayerPromotionLevel(cid) == 1 then
			doPlayerSetPromotionLevel(cid, 2)
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
			doCreatureSay(cid, "You have been promoted!", TALKTYPE_MONSTER_SAY)
		else
			doPlayerSendCancel(cid, "Sorry, not possible.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	
	return true
end
 
Solution
Back
Top