Eu tenho um script de bicicleta que ele funciona normal, mas quando eu jogo ele no chão outro jogador consegue usar ele,
Gostaria de que quando ele estiver no slot e sendo usado não de para jogar ele no chão.
Tipo ele funciona normal ele tem que estar no slot certo, mas só queria fazer com que quando estivesse usando ele não conseguissem jogar ele no chão
Umas imagens para vocês ver como que esta!
Script
Actions:
local config =
{
velocidadeDaSuaBike = 500,
velocidadenormal = 320,
outfitMale = 3142, -- Outfit MALE
outfitFemale = 3141, -- Outfit FEMALE
storageValue = 243656, -- Não mude
}
function onUse(cid, item, itemEx, fromPosition, toPosition)
if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_RING).uid then
doPlayerSendCancel(cid, "Você deve colocar sua bicicleta no local correto.") -- Mensagem que da ao tentar usar a bike fora do slot (by: Lukas)
return TRUE
end
if getPlayerStorageValue(cid, 17001) > 0 or getPlayerStorageValue(cid, 17000) > 0 or getPlayerStorageValue(cid, 63215) > 0 then
doPlayerSendCancel(cid, "Você não pode usar sua bicicleta se estiver voando, nadando ou montando.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
return true
end
if getPlayerStorageValue(cid, 989881) > 0 then
doPlayerSendCancel(cid, "Você não pode subir na sua Bicicleta se estiver pescando.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
return true
end
if isPlayer(cid) and getCreatureOutfit(cid).lookType == 814 then return false end
if getPlayerStorageValue(cid, config.storageValue) <= 0 then
local a = {lookType = config.outfitMale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
local b = {lookType = config.outfitFemale, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}
setPlayerStorageValue(cid, 3624, ""..getPlayerStamina(cid).."")
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, config.velocidadeDaSuaBike)
setPlayerStorageValue(cid, config.storageValue, 1)
if getPlayerSex(cid) == 0 then
doSetCreatureOutfit(cid, b, -1)
else
doSetCreatureOutfit(cid, a, -1)
end
else
setPlayerStorageValue(cid, config.storageValue, 0)
doRemoveCondition(cid, CONDITION_OUTFIT)
doChangeSpeed(cid, -getCreatureSpeed(cid))
doChangeSpeed(cid, config.velocidadenormal)
end
return true
end