Postado Novembro 26, 2016 8 anos Autor 14 minutos atrás, Snowsz disse: @Snowsz Olá amigo, Mesmo problema. [26/11/2016 18:44:43] [Error - CreatureScript Interface] [26/11/2016 18:44:44] data/creaturescripts/scripts/deathBroadcast.lua:onDeath [26/11/2016 18:44:44] Description: [26/11/2016 18:44:45] data/creaturescripts/scripts/deathBroadcast.lua:37: bad argument #3 to 'max' (number expected, got nil) [26/11/2016 18:44:45] stack traceback: [26/11/2016 18:44:46] [C]: in function 'max' [26/11/2016 18:44:46] data/creaturescripts/scripts/deathBroadcast.lua:37: in function <data/creaturescripts/scripts/deathBroadcast.lua:29> Editado Novembro 26, 2016 8 anos por helix758 (veja o histórico de edições) Meu servidor https://www.facebook.com/Heavennoobwar
Postado Novembro 26, 2016 8 anos Solução local config = { affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for? killStorageValue = 3943, deathStorageValue = 3944, -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME rewardItem = { use = true, itemid = 5953, minLevel = false, -- false if you don't want any level req minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed). }, killMessage = { use = true, text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!", messageClass = MESSAGE_STATUS_CONSOLE_BLUE }, killerAnimation = { use = false, text = "Frag!", -- Only 9 letters! No "commands" here. color = 1 }, targetAnimation = { use = false, text = "OWNED!!", -- Only 9 letters! No "commands" here. color = 180 } } function onDeath(cid, corpse, deathList) local killer = deathList[1] if isPlayer(killer) then for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do if getPlayerIp(cid) == getPlayerIp(killer) then return true end local targetKills = (getPlayerStorageValue(cid, config.killStorageValue) > 0 and getPlayerStorageValue(cid, config.killStorageValue) or 0) + 1 local targetDeaths = (getPlayerStorageValue(cid, config.deathStorageValue) > 0 and getPlayerStorageValue(cid, config.deathStorageValue) or 0) + 1 local killerKills = (getPlayerStorageValue(killer, config.killStorageValue) > 0 and getPlayerStorageValue(killer, config.killStorageValue) or 0) + 1 local killerDeaths = (getPlayerStorageValue(killer, config.deathStorageValue) > 0 and getPlayerStorageValue(killer, config.deathStorageValue) or 0) + 1 setPlayerStorageValue(killer, config.killStorageValue, targetKills) setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths) local killerLevel = getPlayerLevel(killer) local targetLevel = getPlayerLevel(cid) local levelDiff = targetLevel - killerLevel local values = { ["KILLERKILLS"] = killerKills, ["KILLERDEATHS"] = killerDeaths, ["KILLERNAME"] = getCreatureName(killer), ["KILLERLEVEL"] = killerLevel, ["TARGETKILLS"] = targetKills, ["TARGETDEATHS"] = targetDeaths, ["TARGETNAME"] = getCreatureName(cid), ["TARGETLEVEL"] = targetLevel } local function formateString(str) return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end))) end if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 1) end if(config.killMessage.use) then doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text)) end if(config.killerAnimation.use) then doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color) end if(config.targetAnimation.use) then doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color) end end end return true end Editado Novembro 26, 2016 8 anos por Snowsz (veja o histórico de edições) _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Novembro 26, 2016 8 anos Autor @Snowsz Funcionou!! Leks @Snowsz Boa mano,. Funcionou porem houve um bug não sei se faz parte dessa script mas acredito que sim, Se liga. 19:29 You owned Qoiqweq! You have now 3 kills! <- eu mato mais de 100 Players e só fica em 3 Kills , tlgd? deveria aumenta 4 Kill, 5 KIll, Poderia ajeitar isso Editado Novembro 26, 2016 8 anos por helix758 (veja o histórico de edições) Meu servidor https://www.facebook.com/Heavennoobwar
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.