nao remove monster em finish event ajudaa y crash mi server, cuando morir jogadores em event
local config = {
playerCount = 2020, -- Global storage for counting the players left/entered in the event
gobletsur = 10127, -- id del premio con nombre.
templeWait = {x = 8964, y = 8597, z = 6}, --- donde los jugadores muertos iran
moneyReward = {12372, 15, 1}, -- second collumn(count) 0 if you don't want money to be used. or a stackable item you want more than 1 of.
-- Estas coordenadas deben ser exactamente las misma del script en global event!
fromPositions = {x = 8940, y = 8587, z = 7}, -- supongo k ya saben como es esto top left cornor of the playground
toPositions = {x = 8958, y = 8605, z = 7}, -- bottom right cornor of the playground
}
local Event_Start = 3032
function onStatsChange(cid, attacker, type, combat, value)
if combat == COMBAT_HEALING then
return true
end
if getCreatureHealth(cid) > value then
return true
end
if isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions) then
if isPlayer(cid) and isMonster(attacker) then
if getGlobalStorageValue(config.playerCount) >= 2 then
doBroadcastMessage(getPlayerName(cid) .. " Ah Muerto En The Surviving Event!", MESSAGE_STATUS_CONSOLE_RED)
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doTeleportThing(cid,config.templeWait,false)
doSendMagicEffect(config.templeWait,10)
doCreatureAddHealth(cid,getCreatureMaxHealth(cid))
doCreatureAddMana(cid,getCreatureMaxMana(cid))
setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1)
setPlayerStorageValue(cid, 97801, -1)
setPlayerStorageValue(cid, 12811, - 1) --- reconoser players que entraron
doRemoveConditions(cid,false)
return true
end
if isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions) then
if isPlayer(cid) and isMonster(attacker) then
if getGlobalStorageValue(config.playerCount) == 1 then
doBroadcastMessage(getPlayerName(cid) .. " Gano The Surviving Event! Congratulations!", MESSAGE_STATUS_WARNING)
local gobletsur = doPlayerAddItem(cid, config.gobletsur, 1)
doItemSetAttribute(gobletsur, "description", "Premio Para " .. getPlayerName(cid) .. " Por Ganar The Surviving Event.")
local corpse = doCreateItem(3058, 1, getPlayerPosition(cid))
doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
doCreatureAddHealth(cid,getCreatureMaxHealth(cid))
doCreatureAddMana(cid,getCreatureMaxMana(cid))
setPlayerStorageValue(cid, 97801, -1)
doPlayerAddItem(cid, 12372, 15)
doRemoveConditions(cid,false)
setPlayerStorageValue(cid, 12811, - 1) --- reconoser players que entraron
setGlobalStorageValue(Event_Start, 0)
setGlobalStorageValue(config.playerCount, 0)
return true
end
for x = config.fromPositions.x, config.toPositions.x do
for y = config.fromPositions.y, config.toPositions.y do
for z = config.fromPositions.z, config.toPositions.z do
areapos = {x = x, y = y, z = z, stackpos = 253}
getMonsters = getThingfromPos(areapos)
if isMonster(getMonsters.uid) then
doRemoveCreature(getMonsters.uid)
end
end
end
end
end
return false
end
end
end
return true
end
info
Grupo: Artesão
Registrado: 10/11/11
Posts: 118
Reputação: +2
nao remove monster em finish event ajudaa y crash mi server, cuando morir jogadores em event
local config = { playerCount = 2020, -- Global storage for counting the players left/entered in the event gobletsur = 10127, -- id del premio con nombre. templeWait = {x = 8964, y = 8597, z = 6}, --- donde los jugadores muertos iran moneyReward = {12372, 15, 1}, -- second collumn(count) 0 if you don't want money to be used. or a stackable item you want more than 1 of. -- Estas coordenadas deben ser exactamente las misma del script en global event! fromPositions = {x = 8940, y = 8587, z = 7}, -- supongo k ya saben como es esto top left cornor of the playground toPositions = {x = 8958, y = 8605, z = 7}, -- bottom right cornor of the playground } local Event_Start = 3032 function onStatsChange(cid, attacker, type, combat, value) if combat == COMBAT_HEALING then return true end if getCreatureHealth(cid) > value then return true end if isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions) then if isPlayer(cid) and isMonster(attacker) then if getGlobalStorageValue(config.playerCount) >= 2 then doBroadcastMessage(getPlayerName(cid) .. " Ah Muerto En The Surviving Event!", MESSAGE_STATUS_CONSOLE_RED) local corpse = doCreateItem(3058, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) doTeleportThing(cid,config.templeWait,false) doSendMagicEffect(config.templeWait,10) doCreatureAddHealth(cid,getCreatureMaxHealth(cid)) doCreatureAddMana(cid,getCreatureMaxMana(cid)) setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)-1) setPlayerStorageValue(cid, 97801, -1) setPlayerStorageValue(cid, 12811, - 1) --- reconoser players que entraron doRemoveConditions(cid,false) return true end if isInArea(getPlayerPosition(cid), config.fromPositions, config.toPositions) then if isPlayer(cid) and isMonster(attacker) then if getGlobalStorageValue(config.playerCount) == 1 then doBroadcastMessage(getPlayerName(cid) .. " Gano The Surviving Event! Congratulations!", MESSAGE_STATUS_WARNING) local gobletsur = doPlayerAddItem(cid, config.gobletsur, 1) doItemSetAttribute(gobletsur, "description", "Premio Para " .. getPlayerName(cid) .. " Por Ganar The Surviving Event.") local corpse = doCreateItem(3058, 1, getPlayerPosition(cid)) doItemSetAttribute(corpse, "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) doCreatureAddHealth(cid,getCreatureMaxHealth(cid)) doCreatureAddMana(cid,getCreatureMaxMana(cid)) setPlayerStorageValue(cid, 97801, -1) doPlayerAddItem(cid, 12372, 15) doRemoveConditions(cid,false) setPlayerStorageValue(cid, 12811, - 1) --- reconoser players que entraron setGlobalStorageValue(Event_Start, 0) setGlobalStorageValue(config.playerCount, 0) return true end for x = config.fromPositions.x, config.toPositions.x do for y = config.fromPositions.y, config.toPositions.y do for z = config.fromPositions.z, config.toPositions.z do areapos = {x = x, y = y, z = z, stackpos = 253} getMonsters = getThingfromPos(areapos) if isMonster(getMonsters.uid) then doRemoveCreature(getMonsters.uid) end end end end end return false end end end return true endbump
bump ajuda porfavooor
bump ajudaa xD
bump
ajuda xD!!
ajuda
ajudaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Editado Outubro 14 por beenii