Postado Janeiro 12, 2021 4 anos Tenho um scripting (mais precisamente um mod) de elo que recebe de acordo com seu frag. Queria saber se teria como adicionar bônus de acordo com o titulo que a pessoa tem. Exemplo: Titulo Calamidade +5 de ML Titulo Lord Demônio +10 de ML e etc Segue o código ai em baixo: <?xml version = "1.0" encoding = "UTF-8"?> <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes"> <config name = "ranks"><![CDATA[ titles = { [5] = "F", [10] = "E", [15] = "D", [20] = "C", [30] = "C+", [40] = "C++", [55] = "B", [70] = "B+", [90] = "B++", [110] = "A", [150] = "A+", [200] = "A++", [300] = "S", [350] = "SS", [400] = "SSS", [500] = "Nacional", [600] = "Continental", [700] = "Mundial", [800] = "Catastrofe", [900] = "Demon Lord", [950] = "Great Demon Lord", [1000] = "Ragnarok" } fragsStorage = 600 ]]></config> <event type = "look" name = "ranksLook" event = "script"><![CDATA[ domodlib("ranks") function onLook(cid, thing, position, lookDistance) if(isPlayer(thing.uid)) then local rank = {rank = "Insignificante", frags = 0} for k, v in pairs(titles) do if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then if(k - 1 > rank.frags) then rank.rank, rank.frags = v, k - 1 end end end doPlayerSetSpecialDescription(thing.uid, "\n Rank: " .. rank.rank) end return true end ]]></event> <event type = "kill" name = "ranksKill" event = "script"><![CDATA[ domodlib("ranks") function onKill(cid, target) if(isPlayer(target)) then setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1)) if(titles[getPlayerStorageValue(cid, fragsStorage)]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!") end end return true end ]]></event> <event type = "login" name = "ranksLogin" event = "script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "ranksKill") registerCreatureEvent(cid, "ranksLook") return true end ]]></event> </mod>
Postado Janeiro 12, 2021 4 anos Solução Tem sim, você vai pegar o metodo que é dado esse "elo" ao jogador. Que no seu script é por storage. Ai você vai criar um script pro tipo de "atributo" que você quer fornecer. Ah quero que ganhe 1000 de vida e 500 de mana se for elo F if getPlayerStorageValue(cid, fragsStorage) == 5 then ai você coloca tudo que precisa acontecer, fazendo essas verificações de storage. Pra adicionar vida/mana eu recomendo vc usar onLogin ou onAdvanced. Se ajudei da like/rep+ ? '' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''
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.