RO
dúvida

Diminuir speed em tal tile

Por rohfagundes, 22 de jun. de 2013 em Scripts

script
8
1.2k
rohfagundesR
22 de junho de 2013 às 14:34

Eae =)

eu comecei a fazer um script pra quando player pisar em tal tile ele ficar com 50 de speed

e fiz assim\/

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
local speedtile = 50
local speed = getCreatureSpeed(cid)
doChangeSpeed(cid, (-speed +speedtile))
return true
end

ate ai ta certo ele diminui a velo de qualquer um a 50

só q n sei como fazer se ele sair desse tile

o speed do player voltar ao q era antes

alguem pode me dar uma ajuda nisso?

Editado Junho 22 por rohfagundes

EnselfE
22 de junho de 2013 às 15:48


function onStepOut(cid)

local speedtile = -50

 

doChangeSpeed(cid, -speedtile)

return true

end

Editado Junho 22 por Enself

rohfagundesR
22 de junho de 2013 às 15:57
function onStepOut(cid)
local speedtile = -50
 
doChangeSpeed(cid, -speedtile)
return true
end

esta fazendo o speed ir a 100

e n volta ao q era antes de pisar no tile

Editado Junho 22 por rohfagundes

EnselfE
22 de junho de 2013 às 17:19

TENTA ESSE

 

speedchange = 50
function onStepIn(cid)
 
doChangeSpeed(cid, getCreatureSpeed(cid) + speedchange)
return true
end
 
function onStepOut(cid)
 
doChangeSpeed(cid, getCreatureSpeed(cid) - speedchange)
return true
end
rohfagundesR
22 de junho de 2013 às 17:39

 

TENTA ESSE

speedchange = 50
function onStepIn(cid)
 
doChangeSpeed(cid, getCreatureSpeed(cid) + speedchange)
return true
end
 
function onStepOut(cid)
 
doChangeSpeed(cid, getCreatureSpeed(cid) - speedchange)
return true
end

agora ficou aumentando a velo em + de 100

SlicerS
22 de junho de 2013 às 18:38

 

local speedchange = 50
local sto = 865488

function onStepIn(cid)
   if not isPlayer(cid) then return true end
   setPlayerStorageValue(cid, sto, getCreatureSpeed(cid))
   doChangeSpeed(cid, -getCreatureSpeed(cid))
   doChangeSpeed(cid, speedchange)
return true
end
 
function onStepOut(cid)
   if not isPlayer(cid) then return true end
   doChangeSpeed(cid, -getCreatureSpeed(cid))
   local oldspeed = getPlayerStorageValue(cid, sto) == -1 and getCreatureBaseSpeed(cid) or getPlayerStorageValue(cid, sto)
   doChangeSpeed(cid, oldspeed)
return true
end
rohfagundesR
22 de junho de 2013 às 19:07

funcionou vlw =D

+rep

 

duvida sanada e ja reportada

1 mês depois...
jeanflamengoJ
14 de julho de 2013 às 23:41

@slicer tem comu tu fazer uma dessas pra poketibia pq tah tenso akii