Ir para conteúdo
  • 0

Bug Fly System


eduardo190696

Pergunta

Opa fala aew, eu peguei o fly system do MatheusMKalo e re adaptei pro meu ot, porem quando eu deslogo em fly da o seguinte erro :

 


[15/09/2012 21:51:28] [Error - CreatureScript Interface] 
[15/09/2012 21:51:28] data/creaturescripts/scripts/DragonSystem.lua:onLogin
[15/09/2012 21:51:28] Description: 
[15/09/2012 21:51:28] (luaGetItemAttribute) Item not found

[15/09/2012 21:51:28] [Error - CreatureScript Interface] 
[15/09/2012 21:51:28] data/creaturescripts/scripts/DragonSystem.lua:onLogin
[15/09/2012 21:51:28] Description: 
[15/09/2012 21:51:28] data/creaturescripts/scripts/DragonSystem.lua:43: attempt to index a nil value
[15/09/2012 21:51:28] stack traceback:
[15/09/2012 21:51:28]  data/creaturescripts/scripts/DragonSystem.lua:43: in function <data/creaturescripts/scripts/DragonSystem.lua:23>
[15/09/2012 21:51:28] Suggest Name has logged out.

 

CreatureScript = DragonSystem.lua

 

 

 

 

function onLogout(cid)

local health,maxhealth = getSummonLifes(cid)

if getPlayerStorageValue(cid, 61204) >= 1 and getPlayerStorageValue(cid, 63215) <= 0 and getPlayerStorageValue(cid, 62314) <= 0 and getPlayerStorageValue(cid, 59987) <= 0 then

setPlayerStorageValue(cid, 61205, health)

setPlayerStorageValue(cid, 61206, maxhealth)

setPlayerStorageValue(cid, 61204, 0)

setPlayerStorageValue(cid, 61207, 1)

end

 

if getPlayerStorageValue(cid, 62314) >= 1 then

pos = getCreaturePosition(cid)

for i = 1,8 do

doRemoveTile(getPosDirs(getCreaturePosition(cid), i))

end

doRemoveTile(getCreaturePosition(cid))

setPlayerStorageValue(cid, 61941, pos.x)

setPlayerStorageValue(cid, 61942, pos.y)

setPlayerStorageValue(cid, 61943, pos.z)

end

return TRUE

end

 

function onLogin(cid)

local drags = {

["Dragon"] = {lookType=267, speed = 1500},

}

 

local dragsfly = {

["Dragon"] = {lookType = 216, speed = 500},

}

 

local dragsride = {

["Dragon"] = {lookType=4, speed = 500},

}

 

if getPlayerStorageValue(cid, 62314) >= 1 then

doCreateTile(460, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)})

doTeleportThing(cid, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)})

for i = 1,8 do

doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i)

end

local item = getDragOutLive(cid)[1]

local a = getItemAttribute(item, "drag"):match("This is (.-)'s book.")

doSetCreatureOutfit(cid, dragsfly[tostring(a)], -1)

doChangeSpeed(cid, dragsfly[tostring(a)].speed)

registerCreatureEvent(cid, "PlayerDragDeath")

end

 

if getPlayerStorageValue(cid, 63215) >= 1 then

local item = getDragOutLive(cid)[1]

local a = getItemAttribute(item, "drag"):match("This is (.-)'s book.")

doSetCreatureOutfit(cid, drags[tostring(a)], -1)

doChangeSpeed(cid, drags[tostring(a)].speed)

registerCreatureEvent(cid, "PlayerDragDeath")

end

 

if getPlayerStorageValue(cid, 59987) >= 1 then

local item = getDragOutLive(cid)[1]

local a = getItemAttribute(item, "drag"):match("This is (.-)'s book.")

doSetCreatureOutfit(cid, dragsride[tostring(a)], -1)

doChangeSpeed(cid, dragsride[tostring(a)].speed)

registerCreatureEvent(cid, "PlayerDragDeath")

end

 

if getPlayerStorageValue(cid, 61207) >= 1 then

local item = getDragOutLive(cid)[1]

doTransformItem(item, dragin)

doRemoveCondition(cid, CONDITION_OUTFIT)

doItemSetAttribute(item, "drag", getItemAttribute(item, "drag"):sub(#getItemAttribute(item, "drag")) ~= "]" and getItemAttribute(item, "drag") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]" or getItemAttribute(item, "drag"))

setPlayerStorageValue(cid, 61207, 0)

end

 

return TRUE

end

 

function onDeath(cid, deathList)

local owner = getCreatureMaster(cid)

doPlayerSendTextMessage(owner, 22, "Your dragon died.")

 

for slot = CONST_SLOT_FIRST, CONST_SLOT_LAST do

local item = getPlayerSlotItem(owner, slot)

if isContainer(item.uid) then

local items = getItemsInContainerById(item.uid, dragout)

for _, ui in pairs(items) do

if getItemAttribute(ui, "drag"):sub(#getItemAttribute(ui, "drag")) == "." then

local maxh = tonumber(getItemAttribute(ui, "drag"):match("/(.+)]"))

doItemSetAttribute(ui, "drag", getItemAttribute(ui, "drag"):sub(1, findLetter(getItemAttribute(ui, "drag"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]")

end

end

end

 

if item.itemid == dragout then

if getItemAttribute(item.uid, "drag"):sub(#getItemAttribute(item.uid, "drag")) == "." then

local maxh = tonumber(getItemAttribute(item.uid, "drag"):match("/(.+)]"))

doItemSetAttribute(item.uid, "drag", getItemAttribute(item.uid, "drag"):sub(1, findLetter(getItemAttribute(item.uid, "drag"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]")

end

end

end

doRemoveCreature(cid)

setPlayerStorageValue(owner, 61207, 0)

setPlayerStorageValue(owner, 61204, 0)

return FALSE

end

 

 

 

Alguém ajuda D;

Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

×
×
  • Criar Novo...