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

[MOD] Help...

GreeNDiZeR

New Member
Joined
Aug 1, 2009
Messages
250
Reaction score
1
Lua:
  <?xml version="1.0" encoding="UTF-8"?>
<mod name="Unlimited AOL" version="1.0" author="husam" contact="[email protected]" enabled="yes">
                <description>
                Forever aol wont let anyone lose any loot even if hes rs or black skull
                </description>
                <item id="2196" article="a" name="Unlimited AOL" override="yes"/>
                <action itemid="2196" event="script"><![CDATA[
                function onDeath(cid, corpse, deathList)
                        if getPlayerItemCount(cid, 2196)>= 1 then 
                        doCreatureSetDropLoot(cid, 0)
                                return false
                        end
                return true
                end
        ]]></event>
</mod>
this script doesnt work =( i need help, i tried without function ondeath too and it doesnt work :S im new scripter
 
did you register onDeath event in the onlogin?
Actually place this in onPrepareDeath :)

My forever aol:
Lua:
        if getPlayerSlotItem(cid, 2).itemid == 2196 then
        	if getPlayerSkullType(cid) == SKULL_RED then
        		local pos = getCreaturePosition(cid)
			local townpos = getTownTemplePosition(getPlayerTown(cid))
						
			doSendMagicEffect(pos, CONST_ME_HOLYAREA)
			doTeleportThing(cid, townpos)
        		doCreatureSetDropLoot(cid, false)
        	else
        		doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS ,0)
        		doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS ,0)
        	end
        end
 
<action is used to register script which are executed when player use item.

For onDeath you need to use <event which is used for registering creatureevents like onLogin, onDeath, onKill, onTrade etc (More you can find in doc/SCRIPTSYSTEM_HELP).

When you use creatureevent you need also to register it onLogin (Except onLogin & onLogout which are executed always)

Try if this works: (it should at least print some messages with 'Untilited AOL')

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Unlimited AOL" version="1.0" author="husam" contact="[email protected]" enabled="yes">
	<description><![CDATA[
		Forever aol wont let anyone lose any loot even if hes rs or black skull.
	]]></description>

	<item id="2196" article="a" name="Unlimited AOL" override="yes"/>

	<event type="login" name="UnlimitedAOL_Login" event="buffer"><![CDATA[
		registerCreatureEvent(cid, 'UnlimitedAOL_Death')
	]]></event>

	<event type="death" name="UnlimitedAOL_Death" event="script"><![CDATA[
		function onDeath(cid, corpse, deathList)
			print('Unlimited AOL: test..')

			if getPlayerItemCount(cid, 2196) >= 1 then
				print('Unlimited AOL: someone died with Unlimited AOL :)')
				doCreatureSetDropLoot(cid, 0)
				return false
			end
			return true
		end
	]]></event>
</mod>
 
Back
Top