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:
error when added this!
script for it:
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>
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: