tem essa função verificava todas as pos pra ver se tem bixo mas eu vou fazer de outro jeito pra vc
EDIT
local playerPosition ={
{x = 499, y = 605, z = 6, stackpos = STACKPOS_TOP_CREATURE},
{x = 500, y = 605, z = 6, stackpos = STACKPOS_TOP_CREATURE},
{x = 501, y = 605, z = 6, stackpos = STACKPOS_TOP_CREATURE},
{x = 502, y = 605, z = 6, stackpos = STACKPOS_TOP_CREATURE},
}
local newPosition =
{
{x = 498, y = 604, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 499, y = 604, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 500, y = 604, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 501, y = 604, z = 7, stackpos = STACKPOS_TOP_CREATURE},
}
local demonsPos =
{
{x = 498, y = 602, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 500, y = 602, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 499, y = 606, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 501, y = 606, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 502, y = 604, z = 7, stackpos = STACKPOS_TOP_CREATURE},
{x = 503, y = 604, z = 7, stackpos = STACKPOS_TOP_CREATURE},
}
-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = TRUE
local trash = {x=503, y=602, z=7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 then
doTransformItem(item.uid, item.itemid - 1)
end
for i = 1, 4 do
player = getThingfromPos(playerPosition)
if player.itemid > 0 then
if isPlayer(player.uid) == TRUE then
if getPlayerLevel(player.uid) >= 100 then
failed = FALSE
end
end
end
if failed == TRUE then
doPlayerSendCancel(cid, "Sorry, not possible.")
return TRUE
end
failed = TRUE
end
for i = 1, #demonsPos do
creature = getThingFromPos(demonsPos)
if(isCreature(creature.uid) == TRUE) then
doCreatureAddHealth(creature, 10000)
else
doSummonCreature("Demon", demonsPos)
end
end
for i = 1, 4 do
doSendMagicEffect(playerPosition, CONST_ME_POFF)
doTeleportThing(player.uid, newPosition, FALSE)
doSendMagicEffect(newPosition, CONST_ME_ENERGYAREA)
end
return TRUE
end
prontoo agora nao tem mais a doCleanArea pode usar como vc estava usando antes que vai funcionar :smile_posivito:
NPC
como assim que erro da? esse npc eu peguei aqui no forum mesmo nao fui eu que fiz mas vou postar outro aqui:
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if(msgcontains(msg, 'soft boots') or msgcontains(msg, 'soft') or msgcontains(msg, 'boots')) then
selfSay('Do you want to repair your worn soft boots for 10000 gold coins?', cid)
talkState[cid] = 2
elseif(msgcontains(msg, 'yes') and talkState[cid] == 2) then
if(getPlayerItemCount(cid, 6530) >= 1) then
if(doPlayerRemoveMoney(cid, 10000) == TRUE) then
doPlayerRemoveItem(cid, 6530, 1)
doPlayerAddItem(cid, 2640)
selfSay('Here you are.', cid)
else
selfSay('Sorry, you don\'t have enough gold.', cid)
end
else
selfSay('Sorry, you don\'t have a worn soft boots.', cid)
end
talkState[cid] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[cid] = 0
selfSay('Come back when you need my services...', cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
esse eu sei que funciona porque eu uso no meu ot :smile_positivo:


info
Grupo: Barão
Registrado: 23/03/08
Posts: 205
Reputação: +4
nuss e sala inteira ou so onde os players fica?
TIPOW na sala tem bixu ja e no script eles sumona outro num e?
tem como fazer pra ele num summonar?
e outra o npc num pega ;x fica dando monte de erro
Editado Julho 14 por TitanicoxD