HE
pedido

Sistema de Correr e mudar Looktype

Por HeelNox, 17 de ago. de 2013 em Scripts

resolvido
script
15
1.3k
HeelNoxH
17 de agosto de 2013 às 11:19

Gostaria que quando o player fala-se "Run" certa vocação muda-se para outra looktype e depois de falar "Run" volta-se a looktype normal.

(OBS: quero que perca 2 pontos de mana por segundo enquanto estiver usando "RUN" e ganhar + 100 de speed)

 

function onSay(cid, words, param)

local hpGain = 5
local vocs = {
[1] = 538,
[2] = 585,
[3] = 536,
}
if not vocs[getPlayerVocation(cid)] then
return true
end
if getPlayerStorageValue(cid, 9329) < 1 then
doCreatureSetNoMove(cid, true)
setPlayerStorageValue(cid, 9329, 1)
heal(cid, hpGain)
doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
elseif getPlayerStorageValue(cid, 9329) >= 1 then
doCreatureSetNoMove(cid, false)
setPlayerStorageValue(cid, 9329, -1)
doRemoveCondition(cid, CONDITION_OUTFIT)
end
return true
end
function heal(uid, hp)
if not isPlayer(uid) then
return true
end
if getPlayerStorageValue(uid, 9329) < 1 then
return true
end
doCreatureAddHealth(uid, hp)
return addEvent(heal, 1 * 1500, uid, hp)
end

 

Tem esse script do Roksas e do Vodkart , se der para usar como base .

Editado Agosto 17 por DarkHeel

RoksasR
17 de agosto de 2013 às 11:38

#GoodLuck.

 

 

function onSay(cid, words, param)
 
local speedGain = 100
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end
 
if getPlayerStorageValue(cid, 9330) < 1 then
    doCreatureSetNoMove(cid, true)
    setPlayerStorageValue(cid, 9330, 1)
    speed(cid, speedGain, 2)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9330) >= 1 then
    doCreatureSetNoMove(cid, false)
    setPlayerStorageValue(cid, 9330, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
end
    return true
end
 
function speed(uid, speed, mlose)
 
if not isPlayer(uid) then
    return true
end

if getCreatureMana(uid) < mlose then
    return true
end
 
if getPlayerStorageValue(uid, 9330) < 1 then
    return true
end
 
doCreatureAddMana(uid, -mlose)
doChangeSpeed(uid, getCreatureSpeed(uid) + speed)
    return addEvent(speed, 1 * 1500, uid, speed)
end
HeelNoxH
17 de agosto de 2013 às 11:52

3 Bugs D=

 

1° Era que você esqueceu de trocar

 

 

doCreatureSetNoMove(cid, true)

2° Apenas perde 1 de mana quando fala !Run , era pra perder a cada 1 seg

 

3° to com 100 de speed usei !Run fiquei com 200 usei !run continuo com 200 ai uso denovo !run fico com 300 (Vai multiplicando)

RoksasR
17 de agosto de 2013 às 11:56

Prontinho!

 

 

function onSay(cid, words, param)
 
local speedGain = 100
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end
 
if getPlayerStorageValue(cid, 9330) < 1 then
    setPlayerStorageValue(cid, 9330, 1)
    speed(cid, speedGain, 2)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9330) >= 1 then
    setPlayerStorageValue(cid, 9330, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
    doChangeSpeed(cid, getCreatureSpeed(cid) - 100)
end
    return true
end
 
function speed(uid, speed, mlose)
 
if not isPlayer(uid) then
    return true
end

if getCreatureMana(uid) < mlose then
    return true
end
 
if getPlayerStorageValue(uid, 9330) < 1 then
    return true
end
 
doCreatureAddMana(uid, -mlose)
doChangeSpeed(uid, getCreatureSpeed(uid) + speed)
    return addEvent(speed, 1 * 1500, uid, speed, mlose)
end
HeelNoxH
17 de agosto de 2013 às 12:01

Continua perdendo mana so quando ativa

 

agora quando você desativa o !run continua com a velocidade que estava antes e depois que usa !run duplica D=

RoksasR
17 de agosto de 2013 às 12:22

 

function onSay(cid, words, param)
 
local speedGain = 100
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end
 
if getPlayerStorageValue(cid, 9330) < 1 then
    setPlayerStorageValue(cid, 9330, 1)
    doChangeSpeed(cid, getCreatureSpeed(uid) + speedGain)
    speed(cid, 2)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9330) >= 1 then
    setPlayerStorageValue(cid, 9330, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
    doChangeSpeed(cid, getCreatureSpeed(cid) - speedGain)
end
    return true
end
 
function speed(uid, mlose)
 
if not isPlayer(uid) then
    return true
end

if getCreatureMana(uid) < mlose then
    return true
end
 
if getPlayerStorageValue(uid, 9330) < 1 then
    return true
end
 
doCreatureAddMana(uid, -mlose)
    return addEvent(speed, 1 * 1500, uid, mlose)
end
HeelNoxH
17 de agosto de 2013 às 12:25
function onSay(cid, words, param)
 
local speedGain = 100
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}
 
if not vocs[getPlayerVocation(cid)] then
    return true
end
 
if getPlayerStorageValue(cid, 9330) < 1 then
    setPlayerStorageValue(cid, 9330, 1)
    doChangeSpeed(cid, getCreatureSpeed(uid) + speedGain)
    speed(cid, 2)
    doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
    
elseif getPlayerStorageValue(cid, 9330) >= 1 then
    setPlayerStorageValue(cid, 9330, -1)
    doRemoveCondition(cid, CONDITION_OUTFIT)
    doChangeSpeed(cid, getCreatureSpeed(cid) - speedGain)
end
    return true
end
 
function speed(uid, mlose)
 
if not isPlayer(uid) then
    return true
end

if getCreatureMana(uid) < mlose then
    return true
end
 
if getPlayerStorageValue(uid, 9330) < 1 then
    return true
end
 
doCreatureAddMana(uid, -mlose)
    return addEvent(speed, 1 * 1500, uid, mlose)
end

 

Agora não muda looktype , duplica a velocidade quando você fala !run !run duas vezes

SlicerS
17 de agosto de 2013 às 12:57

testa ae...

 

 

local speedGain = 100
local manaLose = 1
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}

local function event(uid, mlose, speed)
   if not isPlayer(uid) then
      return true
   end

   if getCreatureMana(uid) < mlose then
      setPlayerStorageValue(uid, 9330, -1)
      doRemoveCondition(uid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(uid) - speed
      doChangeSpeed(uid, -getCreatureSpeed(uid))
      doChangeSpeed(uid, sp)
      return true
   end
 
   if getPlayerStorageValue(uid, 9330) < 1 then
      return true
   end
 
   doPlayerAddMana(uid, -mlose)
   return addEvent(event, 1000, uid, mlose, speed)
end

function onSay(cid, words, param)
   if not vocs[getPlayerVocation(cid)] then
      return true
   end
 
   if getPlayerStorageValue(cid, 9330) < 1 then
      setPlayerStorageValue(cid, 9330, 1)
      local sp = getCreatureSpeed(cid)
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp + speedGain)
      event(cid, manaLose, speedGain)
      doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
   elseif getPlayerStorageValue(cid, 9330) >= 1 then
      setPlayerStorageValue(cid, 9330, -1)
      doRemoveCondition(cid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(cid) - speedGain
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp)
   end
return true
end

 

rok, rok, rok...

Matador18M
17 de agosto de 2013 às 12:59

Nada ver com o Topico Slicer tem Skype?

SlicerS
17 de agosto de 2013 às 13:08

tenhu mais n passo e para de floodar

RoksasR
17 de agosto de 2013 às 13:09

#Matador, se é "nada a ver com o tópico", favor conversar via PM. Na próxima irei te punir, favor não repitir isso novamente.

HeelNoxH
17 de agosto de 2013 às 14:35

testa ae...

 

 

local speedGain = 100
local manaLose = 1
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}

local function event(uid, mlose, speed)
   if not isPlayer(uid) then
      return true
   end

   if getCreatureMana(uid) < mlose then
      setPlayerStorageValue(uid, 9330, -1)
      doRemoveCondition(uid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(uid) - speed
      doChangeSpeed(uid, -getCreatureSpeed(uid))
      doChangeSpeed(uid, sp)
      return true
   end
 
   if getPlayerStorageValue(uid, 9330) < 1 then
      return true
   end
 
   doPlayerAddMana(uid, -mlose)
   return addEvent(event, 1000, uid, mlose, speed)
end

function onSay(cid, words, param)
   if not vocs[getPlayerVocation(cid)] then
      return true
   end
 
   if getPlayerStorageValue(cid, 9330) < 1 then
      setPlayerStorageValue(cid, 9330, 1)
      local sp = getCreatureSpeed(cid)
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp + speedGain)
      event(cid, manaLose, speedGain)
      doSetCreatureOutfit(cid, {lookType = vocs[getPlayerVocation(cid)]}, -1)
   elseif getPlayerStorageValue(cid, 9330) >= 1 then
      setPlayerStorageValue(cid, 9330, -1)
      doRemoveCondition(cid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(cid) - speedGain
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp)
   end
return true
end

 

rok, rok, rok...

 

Funcionou perfeitamente + se eu to com outfit de um citizen colorida , quando eu fala !run ela fica toda branca =/

SlicerS
17 de agosto de 2013 às 14:39

eu odeio esse problema kk'

achu q agora vai...

 

 

local speedGain = 100
local manaLose = 1
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}

local function event(uid, mlose, speed)
   if not isPlayer(uid) then
      return true
   end

   if getCreatureMana(uid) < mlose then
      setPlayerStorageValue(uid, 9330, -1)
      doRemoveCondition(uid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(uid) - speed
      doChangeSpeed(uid, -getCreatureSpeed(uid))
      doChangeSpeed(uid, sp)
      return true
   end
 
   if getPlayerStorageValue(uid, 9330) < 1 then
      return true
   end
 
   doPlayerAddMana(uid, -mlose)
   return addEvent(event, 1000, uid, mlose, speed)
end

function onSay(cid, words, param)
   if not vocs[getPlayerVocation(cid)] then
      return true
   end
 
   if getPlayerStorageValue(cid, 9330) < 1 then
      local out = getCreatureOutfit(cid)
      out.lookType = vocs[getPlayerVocation(cid)]
      setPlayerStorageValue(cid, 9330, 1)
      local sp = getCreatureSpeed(cid)
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp + speedGain)
      event(cid, manaLose, speedGain)
      doSetCreatureOutfit(cid, out, -1)
   elseif getPlayerStorageValue(cid, 9330) >= 1 then
      setPlayerStorageValue(cid, 9330, -1)
      doRemoveCondition(cid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(cid) - speedGain
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp)
   end
return true
end

HeelNoxH
17 de agosto de 2013 às 14:53

 

eu odeio esse problema kk'

achu q agora vai...

 

 

local speedGain = 100
local manaLose = 1
local vocs = {
    [1] = 538,
    [2] = 585,
    [3] = 536,
}

local function event(uid, mlose, speed)
   if not isPlayer(uid) then
      return true
   end

   if getCreatureMana(uid) < mlose then
      setPlayerStorageValue(uid, 9330, -1)
      doRemoveCondition(uid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(uid) - speed
      doChangeSpeed(uid, -getCreatureSpeed(uid))
      doChangeSpeed(uid, sp)
      return true
   end
 
   if getPlayerStorageValue(uid, 9330) < 1 then
      return true
   end
 
   doPlayerAddMana(uid, -mlose)
   return addEvent(event, 1000, uid, mlose, speed)
end

function onSay(cid, words, param)
   if not vocs[getPlayerVocation(cid)] then
      return true
   end
 
   if getPlayerStorageValue(cid, 9330) < 1 then
      local out = getCreatureOutfit(cid)
      out.lookType = vocs[getPlayerVocation(cid)]
      setPlayerStorageValue(cid, 9330, 1)
      local sp = getCreatureSpeed(cid)
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp + speedGain)
      event(cid, manaLose, speedGain)
      doSetCreatureOutfit(cid, out, -1)
   elseif getPlayerStorageValue(cid, 9330) >= 1 then
      setPlayerStorageValue(cid, 9330, -1)
      doRemoveCondition(cid, CONDITION_OUTFIT)
      local sp = getCreatureSpeed(cid) - speedGain
      doChangeSpeed(cid, -getCreatureSpeed(cid))
      doChangeSpeed(cid, sp)
   end
return true
end

 

 

Vlw cara , pensei que se me odiava todo tópico que eu fazia tu passava la nem respondia =X , amanha te do REP+ sem falta esgoto aki .

RoksasR
17 de agosto de 2013 às 14:55

Tópico movido para a seção de dúvidas e pedidos resolvidos.