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

What's wrong with this script?

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Booster" enabled="yes">
	<action itemid="7618;7620" event="script"><![CDATA[
		local hp = 50000
		local mp = 50000
		
		function onUse (cid, item, fromPosition, itemEx, toPosition)
		if item.itemid == 7618 then
		setCreatureMaxHealth(cid,getCreatureMaxHealth(cid)+hp/2)
		doCreatureSay(cid,"+25000 health!",19)
		elseif item.itemid == 7620 then
		setCreatureMaxMana(cid,getCreatureMaxMana(cid)+mp/2)
doCreatureSay(cid,"+25000 mana!",19)
		end
		return true
		end
	]]></action>
</mod>

7618 = health potion, if you use it on yourself you get 25000 health.

7620 = small potion, same as above but u get mana instead.

I don't know why this script doesn't work... no errors in the console or anything.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Booster" enabled="yes">
	<action itemid="7618;7620" event="script"><![CDATA[
		local hp = 25000
		local mp = 25000
		function onUse (cid, item, fromPosition, itemEx, toPosition)
			if item.itemid == 7618 then
				setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + hp)
				doCreatureAddHealth(cid, hp)
				doCreatureSay(cid,'+'..hp..' health!',19)
			elseif item.itemid == 7620 then
				setCreatureMaxMana(cid, getCreatureMaxMana(cid) + mp)
				doCreatureAddMana(cid, mp)
				doCreatureSay(cid,'+'..mp..' mana!',19)
			end
			return true
		end
	]]></action>
</mod>
I've made it also add mana/health when increasing max, so it updates instantly now. :/
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Booster" enabled="yes">
	<action itemid="7618;7620" event="script"><![CDATA[
		local hp = 25000
		local mp = 25000
		function onUse (cid, item, fromPosition, itemEx, toPosition)
			if item.itemid == 7618 then
				if getPlayerStorageValue(cid, 9001) < 1 then
					setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + hp)
					doCreatureAddHealth(cid, hp)
					doCreatureSay(cid,'+'..hp..' health!', 19)
					setPlayerStorageValue(cid, 9001, 1)
				else
					return doPlayerSendCancel(cid, 'You can only use this once!')
				end
			elseif item.itemid == 7620 then
				if getPlayerStorageValue(cid, 9002) < 1 then
					setCreatureMaxMana(cid, getCreatureMaxMana(cid) + mp)
					doCreatureAddMana(cid, mp)
					doCreatureSay(cid,'+'..mp..' mana!', 19)
					setPlayerStorageValue(cid, 9002, 1)
				else
					return doPlayerSendCancel(cid, 'You can only use this once!')
				end
			end
			doRemoveItem(item.uid)
			return true
		end
	]]></action>
</mod>
 
Back
Top