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

Lua Aol with rs protect Need help with my script! Players without the aol 0hp...

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey now i got my rs forevel aol to work but players without the aol they get when you kill them 0hp and dosent die!
using 0.4 dev!

my script:

Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	if(isPlayer(cid) and getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 115) then
		for i = 1, 5 do
		doPlayerAddBlessing(cid, i)
		doCreatureSetDropLoot(cid, false)      
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		doCreatureSay(cid, "Forever Aol I WILL NOT DIE!!!", TALKTYPE_ORANGE_1)
	end
	return true
    end
end
 
Last edited:
try this?

Lua:
function onPrepareDeath(cid, deathList)
	if(isPlayer(cid) and getPlayerSlotItem(cid,CONST_SLOT_NECKLACE).itemid == 115)then
		doCreatureSetDropLoot(cid,false)
		doCreatureSay(cid,'Forever AOL, I won\'t die!',19)
		doTeleportThing(cid,getPlayerTown(cid),false)
		doCreatureAddHealth(cid,100)
		doSendMagicEffect(getThingpos(cid),CONST_ME_HOLYAREA)
		for i = 1,5 do
			doPlayerAddBlessing(cid,i)
		end
	end
	return true
end
 
Stop failing, this whole thread is just complete FAIL.
You must use onStatsChange not onPrepareDeath.

It works for me, good luck.
 
so onstatschange instead of onpeeparedeath but what do i wrte in the .xml?
nvm so it will be statschange in the xml i will test and see thanks if this works and rep +!
Now when i use this script I spamms Forever Aol I WILL NOT DIE!!! on every hit plus after he respawns he cant lose any damage!
And the Bless dosent work some how:S
 
Last edited:
Code:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_MAGIC_BLUE, TEXTCOLOR_GREEN, true)

And players won't be zombies without health bar.
 
so onstatschange instead of onpeeparedeath but what do i wrte in the .xml?
nvm so it will be statschange in the xml i will test and see thanks if this works and rep +!
Now when i use this script I spamms Forever Aol I WILL NOT DIE!!! on every hit plus after he respawns he cant lose any damage!
And the Bless dosent work some how:S
Lua:
for i = 1,5 do
doPlayerAddBlessings(cid, i )

&&
Lua:
function onStatsChange(cid, attacker, type, combat, value)
        if(isPlayer(cid) and getPlayerSlotItem(cid,CONST_SLOT_NECKLACE).itemid == 115)then
                doCreatureSetDropLoot(cid,false)
                doCreatureSay(cid,'Forever AOL, I Pawn you!',19)
                doTeleportThing(cid,getPlayerTown(cid),false)
                doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
                doSendMagicEffect(getCreaturePosotion(cid),CONST_ME_HOLYAREA)
                for i = 1,5 do
                        doPlayerAddBlessing(cid,i)
                end
        end
        return true
end

doCreatureAddHealth(cid,100) i guess was wrong..
 
Last edited:
every hit he Spamms forever aol i pawn you! and he dosent lose any HP when used and i get a error
After a while he lost hp but he was untouchebal he coult lose damage for a while!
After he lost The neckless it just disseperd!

Error:
Code:
[20:47:10.721] [Error - CreatureScript Interface]
[20:47:10.722] data/creaturescripts/scripts/skull amulet.lua:onStatsChange
[20:47:10.722] Description:
[20:47:10.722] attempt to index a number value
[20:47:10.723] stack traceback:
[20:47:10.723]  [C]: in function 'doTeleportThing'
[20:47:10.724]  data/creaturescripts/scripts/skull amulet.lua:5: in function <da
ta/creaturescripts/scripts/skull amulet.lua:1>
 
idk..

Lua:
function onStatsChange(cid, attacker, type, combat, value)
        if(isPlayer(cid) and getPlayerSlotItem(cid,CONST_SLOT_NECKLACE).itemid == 115)then
                doCreatureSetDropLoot(cid,false)
                doCreatureSay(cid,'Forever AOL, I Pawn you!',19)
                doTeleportThing(cid,getPlayerTown(cid),true)
                doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
                doSendMagicEffect(getCreaturePosotion(cid),CONST_ME_HOLYAREA)
                for i = 1,5 do
                   return     doPlayerAddBlessing(cid,i)
     end     
     return false 
     end

or

Lua:
function onStatsChange(cid, attacker, type, combat, value)
        if(isPlayer(cid) and getPlayerSlotItem(cid,CONST_SLOT_NECKLACE).itemid == 115)then
                doCreatureSetDropLoot(cid,false)
                doCreatureSay(cid,'Forever AOL, I Pawn you!',19)
                doTeleportThing(cid,getPlayerTown(cid),true)
                doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
                doSendMagicEffect(getCreaturePosotion(cid),CONST_ME_HOLYAREA)
                for i = 1,5 do
                        doPlayerAddBlessing(cid,i)
                end
        end
        return true
        end
            	doRemoveItem(uid,0)
        	    return false
                end
 
Back
Top