Ir para conteúdo

Featured Replies

Postado

Gostaria de uma adaptação na minha script para que o jogador só consiga usar o item(no meu caso, a bike) se ela estiver dentro da backpack. Se possível, não poder jogar fora enquanto se usa a bike!

function onUse(cid, item, frompos, itemEx, topos)

local bike = {lookType = 738, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0} --- Esse vai ser Homen
local bike1 = {lookType = 737, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0} --- Esse vai ser mulher
local speed = 474 --- Velocidade que a bike terá.

if isPlayer(cid) and not isPremium(cid) and premium == true then
	doTeleportThing(cid, fromPosition, false)
	doPlayerSendCancel(cid, "Only premium accounts can mount.")
return true
end	

if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then   
doPlayerSendCancel(cid, "Você deve colocar sua bike no local correto.") 
return true
end

if getPlayerStorageValue(cid, 17001) == 1 
or getPlayerStorageValue(cid, 63215) == 1 
or getPlayerStorageValue(cid, 17000) == 1 then
doPlayerSendCancel(cid, "Dismount your pokemon to ride.")
return true
end

if getPlayerStorageValue(cid, 32001) == 1 then
   doRemoveCondition(cid, CONDITION_OUTFIT)
   doChangeSpeed(cid, -speed)
   doSendMagicEffect(getPlayerPosition(cid), 18)
   setPlayerStorageValue(cid, 32001, 0)

else

  if getPlayerSex(cid) == 1 then -- homem
   doChangeSpeed(cid, speed)
   doSetCreatureOutfit(cid, bike, -1)
   doSendMagicEffect(getPlayerPosition(cid), 18)
   setPlayerStorageValue(cid, 32001, 1)
  elseif getPlayerSex(cid) == 0 then -- homem
   doChangeSpeed(cid, speed)
   doSetCreatureOutfit(cid, bike1, -1)
   doSendMagicEffect(getPlayerPosition(cid), 18)	
   setPlayerStorageValue(cid, 32001, 1)
  end
  
end
return true

end

 

Postado

Este tópico foi movido para a área correta. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

This topic has been moved to the correct area. This is an automated message!
Please read the forum rules.

 

ichigo.gif
https://github.com/Cjaker/

  , _ ,
 ( o o )
/'` ' `'\                     ESTOU TE OBSERVANDO O_O
|'''''''|
|\\'''//|
   """

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo