Postado Fevereiro 26, 2021 4 anos Bom dia TK, queria saber se alguém pode me dar uma força? No meu servidor tem uma Spell chamada "Muted", eu quero que ela tenha porcentagem em acerta e falhar, entende? se alguém poder me ajudar ficarei muito grato. Script da Magia. local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_TICKS, 5000) local chance = 50 function silence(tar, text) if(isCreature(tar) == true) then doSendAnimatedText(getCreaturePosition(tar), text, 215) doAddCondition(tar, condition) end return true end function onCastSpell(cid, var) if not isPlayer(cid) then return true end if exhaustion.check(cid, 13117) == TRUE then doPlayerSendCancel(cid, "Podera usar novamente dentro de 15 segundos.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end local tar = getCreatureTarget(cid) if hasCondition(tar, CONDITION_MUTED) == true then return false else if isCreature(tar) == true then if math.random(1,50) <= chance then local text = "SILENCE" silence(tar, text) else local text = "MISS" doSendAnimatedText(getCreaturePosition(tar), text, 215) end else if isCreature(cid) == true then doPlayerSendCancel(cid, "Silence can be cast only on other creatures.") end return false end end exhaustion.set(cid, 13117, 15.0) return true end Editado Fevereiro 26, 2021 4 anos por Mikethekingsz (veja o histórico de edições)
Postado Fevereiro 26, 2021 4 anos Spoiler local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_TICKS, 5000) local chance = 50 function silence(tar, text) if(isCreature(tar) == true) then doSendAnimatedText(getCreaturePosition(tar), text, 215) doAddCondition(tar, condition) end return true end function onCastSpell(cid, var) if not isPlayer(cid) then return true end if math.random(1,100) > chance then return true end if exhaustion.check(cid, 13117) == TRUE then doPlayerSendCancel(cid, "Podera usar novamente dentro de 15 segundos.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end local tar = getCreatureTarget(cid) if hasCondition(tar, CONDITION_MUTED) == true then return false else if isCreature(tar) == true then if math.random(1,50) <= chance then local text = "SILENCE" silence(tar, text) else local text = "MISS" doSendAnimatedText(getCreaturePosition(tar), text, 215) end else if isCreature(cid) == true then doPlayerSendCancel(cid, "Silence can be cast only on other creatures.") end return false end end exhaustion.set(cid, 13117, 15.0) return true end
Postado Fevereiro 26, 2021 4 anos Autor @139 Eu queria saber como faço pra subir um "text" dizendo, algo que os players iriam saber que errou o "muted" poderia me ajudar, aparece o "Silence" queria saber se tem como aparecer o "Miss"
Postado Fevereiro 26, 2021 4 anos Solução local chance = 50 local condition = createConditionObject(CONDITION_MUTED) setConditionParam(condition, CONDITION_PARAM_TICKS, 5000) function onCastSpell(cid, var) if not isPlayer(cid) then return false end if math.random(1,100) > chance then doSendAnimatedText(getCreaturePosition(cid), "Miss!", 215) return false end if exhaustion.check(cid, 13117) == true then doPlayerSendCancel(cid, "Podera usar novamente dentro de 15 segundos.") doSendMagicEffect(getCreaturePosition(cid), 2) return false end local tar = variantToNumber(var) if hasCondition(tar, CONDITION_MUTED) == true then return false else if isPlayer(tar) == true then doAddCondition(tar, condition) doSendAnimatedText(getCreaturePosition(tar), "Silenced!", 215) else doPlayerSendCancel(cid, "Silence can be cast only on other players.") return false end end exhaustion.set(cid, 13117, 15.0) return true end Editado Fevereiro 26, 2021 4 anos por 139 (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.