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

My forever aol for rs and bs, dosent work i need help!

TKO

Syphero Owner!
Joined
Mar 10, 2008
Messages
2,252
Reaction score
27
Location
Sweden
Hey i need some help with my aol before it work fine now it dosent work!
if you have rs/bs you dint lose any items when you died but now you lose items when you die!
im using 115 that id couse i have added that to my item.otb
Script for it:
Code:
function onPrepareDeath(cid, deathList)
	if isPlayer(cid) then
		if getPlayerSlotItem(cid, 2).itemid == 115 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerExperience(cid))
			doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
			doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
			doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
			doRemoveConditions(cid, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
			doPlayerPopupFYI(cid, "You are dead.")
			doRemoveCreature(cid)
			return false
		end
	end
	return true
end

error when added this!

Code:
[Error - CreatureScript Interface] 
 data/creaturescripts/scripts/idle.lua:onThink
Description: 
(luaGetThingPosition) Thing not found

[Error - CreatureScript Interface] 
data/creaturescripts/scripts/idle.lua:onThink
Description: 
(luaGetTileInfo) Tile not found
[Error - CreatureScript Interface] 
data/creaturescripts/scripts/idle.lua:onThink
Description: 
data/creaturescripts/scripts/idle.lua:7: attempt to index a boolean value
stack traceback:
data/creaturescripts/scripts/idle.lua:7: in function <data/creaturescripts/scripts/idle.lua:6>
script for it:
Code:
local config = {
	idleWarning = getConfigValue('idleWarningTime'),
	idleKick = getConfigValue('idleKickTime')
}

function onThink(cid, interval)
	if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or
		getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE)) then
		return true
	end

	local idleTime = getPlayerIdleTime(cid) + interval
	doPlayerSetIdleTime(cid, idleTime)
	if(config.idleKick > 0 and idleTime > config.idleKick) then
		doRemoveCreature(cid)
	elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then
		local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"
		if(config.idleKick > 0) then
			message = message .. ", you will be disconnected in "
			local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)
			if(diff > 1) then
				message = message .. diff .. " minutes"
			else
				message = message .. "one minute"
			end

			message = message .. " if you are still idle"
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")
	end

	return true
end
 
Last edited:
I think you dont need a whole script for a forever aol.
Just change items.xml
Find :
PHP:
<item id="2173" article="an" name="amulet of loss">		
<attribute key="weight" value="420"/>
<attribute key="slotType" value="necklace"/>
<attribute key="preventDrop" value="1"/>
<attribute key="charges" value="1"/>
</item>
and delete :
PHP:
<attribute key="charges" value="1"/>
If you want other item than amulet of loss for exemple broken amulet add :
PHP:
<attribute key="preventDrop" value="1"/>
 
nicer tabbed ;)

Lua:
function onPrepareDeath(cid, deathList)
	if isPlayer(cid) then
		if getPlayerSlotItem(cid, 2).itemid == 115 then
	   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerExperience(cid))
	     doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
	       doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
	          doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
	            doRemoveConditions(cid, FALSE)
	              doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
			doPlayerPopupFYI(cid, "You are dead.")
			  doRemoveCreature(cid)
		end
		   return false
	     else
	  end
    return true
end
 
You did it wrong.
Code:
function onPrepareDeath(cid, deathList)
	if isPlayer(cid) then
		if getPlayerSlotItem(cid, 2).itemid == 115 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerExperience(cid))
			doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
			doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
			doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
			doRemoveConditions(cid, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
			doPlayerPopupFYI(cid, "You are dead.")
			doRemoveCreature(cid)
		end
		return false
	end
	return true
end
 
You did it wrong.
Code:
function onPrepareDeath(cid, deathList)
	if isPlayer(cid) then
		if getPlayerSlotItem(cid, 2).itemid == 115 then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerExperience(cid))
			doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
			doCreatureAddHealth(cid, getCreatureMaxHealth(cid), true)
			doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
			doRemoveConditions(cid, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
			doPlayerPopupFYI(cid, "You are dead.")
			doRemoveCreature(cid)
		end
		return false
	end
	return true
end
script works but then they die at tempel it gets a cross that lights up and it lags.
and i got error in consol like this:
Code:
[09/12/2009 06:44:33] [Error - CreatureScript Interface] 
[09/12/2009 06:44:33] data/creaturescripts/scripts/idle.lua:onThink
[09/12/2009 06:44:33] Description: 
[09/12/2009 06:44:33] (luaGetThingPosition) Thing not found

[09/12/2009 06:44:33] [Error - CreatureScript Interface] 
[09/12/2009 06:44:33] data/creaturescripts/scripts/idle.lua:onThink
[09/12/2009 06:44:33] Description: 
[09/12/2009 06:44:33] (luaGetTileInfo) Tile not found

[09/12/2009 06:44:33] [Error - CreatureScript Interface] 
[09/12/2009 06:44:33] data/creaturescripts/scripts/idle.lua:onThink
[09/12/2009 06:44:33] Description: 
[09/12/2009 06:44:33] data/creaturescripts/scripts/idle.lua:7: attempt to index a boolean value
[09/12/2009 06:44:33] stack traceback:
[09/12/2009 06:44:33] 	data/creaturescripts/scripts/idle.lua:7: in function <data/creaturescripts/scripts/idle.lua:6>
 
Back
Top