Ir para conteúdo

Featured Replies

Postado

Servidor que utilizo como base: TFS 1.2 Versão 10.98

Preciso de ajuda:

No meu servidor quando o player utiliza a Bike ele fica com as cores da outfit toda branca.

Antes de usar a bike:

image.thumb.png.bce59496a441f0acad6cf657e0bfb531.png

 

Após usar a bike:

image.thumb.png.51b8b9d6c1ce7108cdf5ed77ecf2f907.png

 

Eu gostaria que, quando o player utilizasse a Bike ele se mante-se com as cores da outfit que ele já estava utilizando.


Código disponível: 

Spoiler

 



local delay = 0.1
local bonusSpeed = 1.2
local outfitMale = 2871
local outfitFemale = 2870
local condition = Condition(CONDITION_OUTFIT)
condition:setTicks(-1)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
	if os.time() > player:getStorageValue(storageDelay) then
	       	player:setStorageValue(storageDelay, os.time() + delay)
	else
		player:sendCancelMessage(RETURNVALUE_YOUAREEXHAUSTED)
		return true
	end

	if fromPosition.x ~= 65535 then
		player:sendCancelMessage("First pick up the bicycle.")
		return true
	end

	if player:getStorageValue(storageBike) == 1 then
		player:sendCancelMessage("Sorry, not possible while on bike.")
		return true
	end

	if player:getStorageValue(storageMecha) == 1 then
		player:sendCancelMessage("Sorry, not possible while on mecha.")
		return true
	end
	
	if player:getStorageValue(storageCannoMecha) == 1 then
		player:sendCancelMessage("Sorry, not possible while on canno mecha.")
		return true
	end

	if player:getStorageValue(storageFlameMecha) == 1 then
		player:sendCancelMessage("Sorry, not possible while on flame mecha.")
		return true
	end
	
	if player:getStorageValue(storageForestMecha) == 1 then
		player:sendCancelMessage("Sorry, not possible while on forest mecha.")
		return true
	end
	
	if player:getStorageValue(storageNightmareMecha) == 1 then
		player:sendCancelMessage("Sorry, not possible while on nightmare mecha.")
		return true
	end

	if player:getStorageValue(storageBlackMotorcycle) == 1 then
		player:sendCancelMessage("Sorry, not possible while on black motorcycle.")
		return true
	end
	
	if player:getStorageValue(storageBlueMotorcycle) == 1 then
		player:sendCancelMessage("Sorry, not possible while on blue motorcycle.")
		return true
	end
	
	if player:getStorageValue(storageGreenMotorcycle) == 1 then
		player:sendCancelMessage("Sorry, not possible while on green motorcycle.")
		return true
	end
	
	if player:getStorageValue(storagePinkMotorcycle) == 1 then
		player:sendCancelMessage("Sorry, not possible while on pink motorcycle.")
		return true
	end
	
	if player:getStorageValue(storageRedMotorcycle) == 1 then
		player:sendCancelMessage("Sorry, not possible while on red motorcycle.")
		return true
	end
	
	if player:getStorageValue(storageYellowMotorcycle) == 1 then
		player:sendCancelMessage("Sorry, not possible while on yellow motorcycle.")
		return true
	end
	
	if player:getStorageValue(storageFutureMotorcycle) == 1 then
		player:sendCancelMessage("Sorry, not possible while on future motorcycle.")
		return true
	end

	if player:getStorageValue(storageRide) == 1 then
		player:sendCancelMessage("Sorry, not possible while on ride.")
		return true
	end

	if player:getStorageValue(storageFly) == 1 then
		player:sendCancelMessage("Sorry, not possible while on fly.")
		return true
	end

	if player:getStorageValue(storageSurf) > 0 then
		player:sendCancelMessage("Sorry, not possible while on surf.")
		return true
	end

	if player:getStorageValue(storageDive) > 0 then
		player:sendCancelMessage("Sorry, not possible while on dive.")
		return true
	end

	if player:getStorageValue(storageEvent) > 0 then
		player:sendCancelMessage("Sorry, not possible while on event.")
		return true
	end
	if player:getStorageValue(storageBicycle) > 0 then
		player:removeCondition(CONDITION_OUTFIT)
		player:changeSpeed(player:getBaseSpeed()-player:getSpeed())
		player:setStorageValue(storageBicycle, -1)
	else
	if player:getSex() == PLAYERSEX_MALE then outfit = outfitMale else outfit = outfitFemale end
	local delta = player:getSpeed() * bonusSpeed
		condition:setOutfit({lookType = outfit})
		player:addCondition(condition)
		player:setStorageValue(storageBicycle, 1)
		player:changeSpeed(delta)
	end

	return true
end
 

 

 

 

 

 

Editado por lessa1994
Removi uma print. (veja o histórico de edições)

wfeehlz.png

 

Nunca foi tão fácil jogar Pokémon!

 

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo