Postado Agosto 20, 2019 5 anos Galera, eu preciso de uma script de ao logar, irá verificar se tem uma x storage, se tiver essa x storage ele dobra o exp(a exp pode ser configuravel)
Postado Agosto 20, 2019 5 anos Creaturescript: local storage = 48999 -- str que precisa ter function onLogin(cid) local rate = 1.3 -- 30%, 1.2 = 20%... if getPlayerStorageValue(cid) == storage then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Você tem "..((rate - 1)*100).."% de exp a mais!") end return true end function onKill(cid, target) if isPlayer(cid) and isMonster(target) then if getPlayerStorageValue(cid) == storage then local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = ((getMonsterInfo(string.lower(getCreatureName(target))).experience*1.3*exp)/2) --30% doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end end return true end <event type="login" name="ExpGuild_L" event="script" value="arquivo.lua"/> <event type="kill" name="ExpGuild" event="script" value="arquivo.lua"/> Só registrar o kill no seu login.lua. ╔══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ══════════════════════════╗ Te Ajudei? Rep + e ficamos Quits Precisando de ajuda? Discord: Yan Liima #3702 Programador Júnior de LUA, PHP e JavaScript Juntos somos lendas, separados somos Mitos! ╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝
Postado Agosto 20, 2019 5 anos Autor 49 minutos atrás, Yan Liima disse: Creaturescript: local storage = 48999 -- str que precisa ter function onLogin(cid) local rate = 1.3 -- 30%, 1.2 = 20%... if getPlayerStorageValue(cid) == storage then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Você tem "..((rate - 1)*100).."% de exp a mais!") end return true end function onKill(cid, target) if isPlayer(cid) and isMonster(target) then if getPlayerStorageValue(cid) == storage then local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier) local count = ((getMonsterInfo(string.lower(getCreatureName(target))).experience*1.3*exp)/2) --30% doPlayerAddExperience(cid, count) addEvent(doSendAnimatedText, 500, getCreaturePosition(cid), '+'..count, math.random(50,60)) end end return true end <event type="login" name="ExpGuild_L" event="script" value="arquivo.lua"/> <event type="kill" name="ExpGuild" event="script" value="arquivo.lua"/> Só registrar o kill no seu login.lua. Mano, aparentemente está funcionando, porém quando eu tento aumentar a % de exp, não faz diferença alguma
Postado Agosto 23, 2019 5 anos Solução arquivo /data/creaturescripts/scripts/double.lua function onLogin(cid) local storage = 998899 -- STORAGE QUE QUER USAR local xp = 2 -- QUANTIDADE QUE VAI MULTIPLICAR O XP if getPlayerStorageValue(cid, storage) == 1 then local rates = getPlayerRates(cid) doCreatureSay(cid, "Voce esta com o XP dobrado, aproveite!", TALKTYPE_ORANGE_1, true, cid) doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*xp) end return true end tag /data/creaturescripts/creaturescripts.xml <event type="login" name="double" event="script" value="double.lua"/>
Postado Agosto 24, 2019 5 anos Autor Em 23/08/2019 em 14:23, Kemmlly disse: arquivo /data/creaturescripts/scripts/double.lua function onLogin(cid) local storage = 998899 -- STORAGE QUE QUER USAR local xp = 2 -- QUANTIDADE QUE VAI MULTIPLICAR O XP if getPlayerStorageValue(cid, storage) == 1 then local rates = getPlayerRates(cid) doCreatureSay(cid, "Voce esta com o XP dobrado, aproveite!", TALKTYPE_ORANGE_1, true, cid) doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*xp) end return true end tag /data/creaturescripts/creaturescripts.xml <event type="login" name="double" event="script" value="double.lua"/> Funcionou, obrigado.
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.