Postado Março 7, 2015 10 anos Esse script está dando o seguinte erro. erro Mostrar conteúdo oculto [Error - NpcScript Interface] [16:13:26.071] data/npc/scripts/Arnold.lua [16:13:26.071] Description: [16:13:26.071] data/npc/scripts/Arnold.lua:10: attempt to call global 'Condition' (a nil value) [16:13:26.071] [Warning - NpcEvents::NpcEvents] Cannot load script: data/npc/scripts/Arnold.lua Script Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local condition = Condition(CONDITION_FIRE) condition:setParameter(CONDITION_PARAM_DELAYED, 1) condition:addDamage(10, 1000, -10) local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if isInArray({"fuck", "idiot", "asshole", "ass", "fag", "stupid", "tyrant", "shit", "lunatic"}, msg) then npcHandler:say("Take this!", cid) local player = Player(cid) player:getPosition():sendMagicEffect(CONST_ME_EXPLOSIONAREA) player:addCondition(condition) npcHandler:releaseFocus(cid) npcHandler:resetNpc(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Março 7, 2015 10 anos Solução Tenta esse, se tiver algo errado me fala que eu tento modificar aqui! local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end if isInArray({"fuck", "idiot", "asshole", "ass", "fag", "stupid", "tyrant", "shit", "lunatic"}, msg) then npcHandler:say("Take this!", cid) doAddCondition(cid, 3) npcHandler:releaseFocus(cid) npcHandler:resetNpc(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.