Postado Outubro 15, 2024 Out 15 Galeera, estou tentando usar esse script de CRITICAL no meu ot, porem esta dando esse error. Eu usava ele nao Rev 3777. Porem estou usando a 0.4_SVN (rev 3996). Porem esta dando esse error no OT. Alguem poderia me ajudar como resolver pf ? >< Actions <action itemid="12575" event="script" value="criticalrock.lua"/> Citar --- CRITICAL System by Night Wolf local config = { levelscrit = 100, --- leveis que terão storagecrit = 48913 -- storage que será verificado } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then doRemoveItem(item.uid, 1) doPlayerSendTextMessage(cid,18,"[Critical]: ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/"..config.levelscrit.."].") setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1) elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then doPlayerSendTextMessage(cid,18,"Voce ja chegou no maximo de [Critical]. Parabens.") return 0 end return 1 end creaturescripts: <event type="statschange" name="critical" event="script" value="critical.lua"/> Login: registerCreatureEvent(cid, "critical") Moster: <script> <event name="critical"/> </script> Citar --[[Headshot System ------------------------- By Night Wolf]] local lvlcrit = 48913 local multiplier = 2.0 function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then if (getPlayerStorageValue(attacker, lvlcrit)*1) >= math.random (0,1000) then dano = math.ceil(value*(multiplier)) doTargetCombatHealth(attacker, cid, combat, -dano, -dano, 215) doSendAnimatedText(getCreaturePos(attacker), "CRITICAL", 180) return false end end return true end ERROR: [19:33:31.495] [Error - CreatureEvent::executeCombat] Call stack overflow. _______________________________________________________________________________________________________________________ Esse aqui funciona normalmente. Porem eu queria por storage e por item, nao por skill. Alguem me da help PF ! Citar local config = { SKILL_ID = 0, -- id do skill... multiplier = 1.5, percentual = 0.5, } function onLogin(cid) registerCreatureEvent(cid, "critical") registerCreatureEvent(cid, "comcriti") return true end function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and (not (attacker == cid)) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then local chance = (getPlayerSkillLevel(attacker, config.SKILL_ID) * config.percentual) * 10 if math.random(1, 1400) <= chance then dano = math.ceil(value*(config.multiplier)) doTargetCombatHealth(attacker, cid, combat, -dano, -dano, 255) doSendAnimatedText(getCreaturePos(attacker), "CRITICAL", 180) return false end end return true end function onCombat(cid, target) if isPlayer(cid) and isMonster(target) then registerCreatureEvent(target, "critical") end return true end Editado Outubro 15, 2024 Out 15 por Doidodepeda (veja o histórico de edições)
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.