bom meu amigo esse script é do meu server cara quando eu fiz funfo perfect vc deve ter mechido em algo
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- [Duvida] Bike System Para Poketibia
[Duvida] Bike System Para Poketibia
Por icaro2507, 07 de jan. de 2012 em Archived
info
Grupo: Artesão
Registrado: 24/10/11
Posts: 133
Reputação: +55
Char no Tibia: ...

Icaro, vc pode acertar isso desta forma:
Adicione no inicil do arquivo
local sBike = 5701
Substitua:
doChangeSpeed(cid, 100000)
Por:
BikeSpeedOn(cid,100000)
Adicione antes de:
return doRemoveCondition(cid, CONDITION_OUTFIT)
BikeSpeedOff(cid)
Ficando assim:
BikeSpeedOff(cid)
return doRemoveCondition(cid, CONDITION_OUTFIT)
Para terminar adicione antes de:
function onUse(cid, item, fromPosition, itemEx, toPosition)
function BikeSpeedOn(cid,nSpeed)
setPlayerStorageValue(cid,sBike,getCreatureSpeed(cid))
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,nSpeed)
end
function BikeSpeedOff(cid)
doChangeSpeed(cid,-getCreatureSpeed(cid))
doChangeSpeed(cid,getPlayerStorageValue(cid,sBike))
end
Pronto com isso ira ter mais velocidade quando estiver na BIKE e ao sair dela volta na velocidade normal do char.
info
Grupo: Artesão
Registrado: 24/10/11
Posts: 133
Reputação: +55
Char no Tibia: ...

local bikeCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bikeCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bikeCondition, {lookType = LOOKTYPE DA BLICICLETA, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local t = {
[ID DO ITEM] = {article='a' ,name='bike male', text='Mount, bike Male!', dtext='Demount, bike Male!', s=5700, condition=bikeCondition},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v, r = getCreaturePosition(cid), t[item.itemid]
local s = r.s
local pos = {x = v.x, y = v.y, z = v.z}
if r then
if getPlayerStorageValue(cid, 25000) == 5 then
return
end
if getPlayerStorageValue(cid, 23000) == 5 then
return
end
if #getCreatureSummons(cid) >= 1 then
return
end
if getPlayerStorageValue(cid, s) <= 0 then
doSendMagicEffect(pos, 177)
doCreatureSay(cid, r.text, 19)
setPlayerStorageValue(cid, s, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted ' .. r.article .. ' '.. r.name .. '.')
return doAddCondition(cid, r.condition)
elseif getPlayerStorageValue(cid, s) == 1 then
doSendMagicEffect(pos, 177)
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have demounted ' .. r.article .. ' '.. r.name .. '.')
return doRemoveCondition(cid, CONDITION_OUTFIT)
else
return doPlayerSendCancel(cid, 'You can\'t do this.')
end
else
return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
end
end
Aqui acontece o seguinte erro;
LuaScriptInterface::luaAddOutfitCondition(). This function can only be used while loading the script.
info
Grupo: Artesão
Registrado: 24/10/11
Posts: 133
Reputação: +55
Char no Tibia: ...

bike.lua
local bikeCondition = createConditionObject(CONDITION_OUTFIT)setConditionParam(bikeCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bikeCondition, {lookType = LOOK-BIKE, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local t = {
[iTEM-USE-BIK-ID = {article='a' ,name='bike', text='Mount, bike!', dtext='Demount, bike!', s=100, condition=bikeCondition},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v, r = getCreaturePosition(cid), t[item.itemid]
local s = r.s
local pos = {x = v.x, y = v.y, z = v.z}
if r then
if getPlayerStorageValue(cid, s) <= 0 then
doSendMagicEffect(pos, 10)
doCreatureSay(cid, r.text, 19)
setPlayerStorageValue(cid, s, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have mounted ' .. r.article .. ' '.. r.name .. '.')
doChangeSpeed(cid, 100)
return doAddCondition(cid, r.condition)
elseif getPlayerStorageValue(cid, s) == 1 then
doSendMagicEffect(pos, 10)
doCreatureSay(cid, r.dtext, 19)
setPlayerStorageValue(cid, s, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You have demounted ' .. r.article .. ' '.. r.name .. '.')
return doRemoveCondition(cid, CONDITION_OUTFIT)
else
return doPlayerSendCancel(cid, 'You can\'t do this.')
end
else
return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'Report bugs in Bike system.')
end
end
Tag action/action.xml
<action itemid="ITEM-USE-BIK-ID" event="script" value="bikesystem.lua"/>
Creditos do script:
132820
CrazzyMaster
Editado Janeiro 14 por CrazzyMaster
BIKE
local bikeCondition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(bikeCondition, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(bikeCondition, {lookType = 1394, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
local t = {
[2547] = {article='a' ,name='bike', text='Mount, bike!', dtext='Demount, bike!', s=7700, condition=bikeCondition},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v, r = getCreaturePosition(cid), t[item.itemid]
local s = r.s
local pos = {x = v.x, y = v.y, z = v.z}
if r then
if getPlayerStorageValue(cid, 25000) == 5 then
return
end
if getPlayerStorageValue(cid, 23000) == 5 then
return
end
if getPlayerStorageValue(cid, s) <= 0 then
doCreatureSay(cid, r.text, TALKTYPE_SAY)
setPlayerStorageValue(cid, s, 1)
return doAddCondition(cid, r.condition)
elseif getPlayerStorageValue(cid, s) == 1 then
doCreatureSay(cid, r.dtext, TALKTYPE_SAY)
setPlayerStorageValue(cid, s, 0)
return doRemoveCondition(cid, CONDITION_OUTFIT)
else
return doPlayerSendCancel(cid, 'You can\'t do this.')
end
else
return doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, 'There has been some error, try contacting a staff member.')
end
end






info
Grupo: Campones
Registrado: 25/11/11
Posts: 6
Reputação: 0
Char no Tibia: Sekmeet
Ola!
Bom eu tenho um duvida sobre o meu script quando usa o System ele aumenta a speed mas quando desse da bike ela continua com a mesmo velocidade como se o player estiveste na bike.