Ir para conteúdo

Pergunta

Me ajuda?!

Deu esse erro aqui quando começa a aparecer as 3 paredes :(

Tibia versão: 8.54

 

[16/05/2012 14:49:02] [Error - Action Interface]

[16/05/2012 14:49:02] In a timer event called from:

[16/05/2012 14:49:02] data/actions/scripts/cassino.lua:onUse

[16/05/2012 14:49:02] Description:

[16/05/2012 14:49:02] (luaDoTransformItem) Item not found

 

[16/05/2012 14:49:08] [Error - Action Interface]

[16/05/2012 14:49:08] In a timer event called from:

[16/05/2012 14:49:08] data/actions/scripts/cassino.lua:onUse

[16/05/2012 14:49:08] Description:

[16/05/2012 14:49:08] (luaDoTransformItem) Item not found

 

[16/05/2012 14:49:14] [Error - Action Interface]

[16/05/2012 14:49:14] In a timer event called from:

[16/05/2012 14:49:14] data/actions/scripts/cassino.lua:onUse

[16/05/2012 14:49:14] Description:

[16/05/2012 14:49:14] (luaDoTransformItem) Item not found

 

Script que eu usei:

--[[
	Advanced Slot Machine
			by EddyHavoc
]]--

--REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
local money = 1

--MILISECONDS TO CHANGE FRUITS
local time = 200

--ITERATOR TIME TO STOP CHANGING FRUIT IF PLAYER DOESN'T (30 is like 7 seconds)
local limit = 30

--FRUITS THAT WILL RANDOMLY APPEAR AND SWITCH
local fruits = {1128,1129,1132,1133,1144,1148,1146,1152}

--PRIZES TABLES
local win = {
-- [{FRUIT.1,FRUIT.2,FRUIT.3} = {PRIZE,#PRIZE}]
	--MIXED COMBOS
	[{1144,1144,1144}] = {2160,2},  -- cherry-pumpkin-cherry
	[{1152,1152,1152}] = {2160,1},  -- lemon-melon-lemon
	--TRIPLE COMBOS
	[{1128,1129,1132}] = {2152,10}, -- triple strawberry
	[{1133,1144,1152}] = {2152,20}, -- triple mango
	--ANY COMBOS
	[{ANY,1128,1129}] = {2152,50}, -- double pumpkin right
	[{1132,1133,ANY}] = {2152,50}, -- double pumpkin left
	[{1144,ANY,1144}] = {2152,100}, -- pumpkin sides combo
	[{ANY,1148,1148}] = {2152,40}, -- double cherry right
	[{1152,1152,ANY}] = {2152,40}, -- double cherry left
}

--MESSAGES THAT RANDOMLY APPEAR WHEN PLAYER WINS
local messages = {'Bingo!','Lucky!','Jackpot!','Win!'}

--FRUITS ROWS
local p = { --[LEVER.UNIQUEID]
	[6297] = {},[6298] = {},[6299] = {},[6300] = {}, --[6301] = {},
} --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED
for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT}
	table.insert(p[6297],i,{x=865+(i-1),y=732,z=7,stackpos=1})
	table.insert(p[6298],i,{x=95+(i-1),y=145,z=7,stackpos=1})
	table.insert(p[6299],i,{x=99+(i-1),y=145,z=7,stackpos=1})
	table.insert(p[6300],i,{x=103+(i-1),y=145,z=7,stackpos=1})
	-- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1})
end

function verifyRow(cid, array, pos)
	local result, prize = false, ''
	for a, b in pairs(win) do
			if getTileItemById(pos[1],a[1]).uid > 1 or a[1] == ANY then
					if getTileItemById(pos[2],a[2]).uid > 1 or a[2] == ANY then
							if getTileItemById(pos[3],a[3]).uid > 1 or a[3] == ANY then
									doPlayerAddItem(cid, b[1], b[2] or 1, true)
									doSendAnimatedText(getThingPos(cid), messages[math.random(#messages)], math.random(255))
									result, prize, amount = true, b[1], b[2]
							end
					end
			end  
	end
	if prize ~= '' then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won '..amount..' '..getItemPluralNameById(prize)..'!')
	end
	for i = 1,3 do
			doSendMagicEffect(pos[i], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
			doRemoveItem(getTileThingByPos(pos[i]).uid)
	end
	return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine  Try again')
end

function onUse(cid, item, fromPosition, itemEx, toPosition)

	local function doFruit(pos,cid,id,limit)
			if not isPlayer(cid) then
					return doItemEraseAttribute(item.uid, 'aid'), getTileThingByPos(pos).uid > 0 and doRemoveItem(getTileThingByPos(pos).uid)
			end
			if getTileThingByPos(pos).itemid < 1 then
					doSendMagicEffect(pos, CONST_ME_POFF)
					doCreateItem(fruits[math.random(#fruits)], 1, pos)
			else
					doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
			end
			if limit <= 0 then
					doSendMagicEffect(pos,math.random(28,30))			
					doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
					doItemSetAttribute(getTileThingByPos(fromPosition)  .uid, 'aid', getTileThingByPos(fromPosition).actionid+1)
					doTransformItem(getTileThingByPos(fromPosition).ui , getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826)
			elseif getTileThingByPos(fromPosition).actionid > id then
					doSendMagicEffect(pos,math.random(28,30))
					doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
			else
					addEvent(doFruit,time,pos,cid,id,limit-1)
			end
	end

	if item.actionid == 0 then
			if not doPlayerRemoveMoney(cid, money) then  
					return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need '..money..' gps to play Slot Machine.')
			end
			doItemSetAttribute(item.uid, 'aid', 1)
			doCreatureSetNoMove(cid, true)
			doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
			doSendAnimatedText(getThingPos(cid), '-$'..money,COLOR_RED)
			for i = 1,3 do doFruit(p[item.uid][i],cid,i,i*limit) end
	elseif isInArray({1,2,3},item.actionid) then
			doItemSetAttribute(item.uid, 'aid', item.actionid+1)
			doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
	elseif item.actionid == 4 then
			doCreatureSetNoMove(cid, false)
			doItemEraseAttribute(item.uid, 'aid')
			doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
			verifyRow(cid, win, p[item.uid])	
	end		  
	return true
end

 

VALENDO +REP

Editado por Flaah
Link para o comentário
https://xtibia.com/forum/topic/186226-ajuda-action-ca%C3%A7a-niquel-ajuda/
Compartilhar em outros sites

6 respostass a esta questão

Posts Recomendados

  • 0

tente esse que eu uso no meu ot

 

-- Cassino System by LucasHere

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

pos1 = {x=256, y=344, z=7, stackpos=1} --posição que vai cria os items

pos2 = {x=257, y=344, z=7, stackpos=1}

pos3 = {x=258, y=344, z=7, stackpos=1}

local config = {

moneyneed = 10000 -- dinheiro para jogar

}

local premio = 2160 -- id do premio

local premio_cont = 2 -- quantidade do premio que vai ganhar

 

function additem(cid,premio,premio_cont)

doPlayerAddItem(cid, premio,premio_cont)

end

if item.itemid == 1945 and getPlayerMoney(cid) < config.moneyneed then

doPlayerSendCancel(cid,"Desculpe,voce não grana suficiente para jogar!")

return FALSE

end

if item.itemid == 1945 and math.random(0, 8) == 1 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

doCreateItem(6556,1,pos1)

addEvent(doCreateItem, 1000, 6556, 1, pos2)

addEvent(doCreateItem, 2000, 6556, 1, pos3)

addEvent(additem,2000,cid,premio,premio_cont)

return true

elseif item.itemid == 1945 and math.random(0, 8) == 2 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

doCreateItem(6557,1,pos1)

addEvent(doCreateItem, 1000, 6557, 1, pos2)

addEvent(doCreateItem, 2000, 6556, 1, pos3)

return true

elseif item.itemid == 1945 and math.random(0, 8) == 3 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

doCreateItem(6557,1,pos1)

addEvent(doCreateItem, 1000, 6557, 1, pos2)

addEvent(doCreateItem, 2000, 6557, 1, pos3)

addEvent(additem,2000,cid,premio,premio_cont)

return true

elseif item.itemid == 1945 and math.random(0, 8) == 4 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

addEvent(doCreateItem, 1000, 6556, 1, pos2)

addEvent(doCreateItem, 2000, 6556, 1, pos3)

doCreateItem(6557,1,pos1)

return true

elseif item.itemid == 1945 and math.random(0, 8) == 5 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

addEvent(doCreateItem, 1000, 6557, 1, pos2)

addEvent(doCreateItem, 2000, 6556, 1, pos3)

doCreateItem(6557,1,pos1)

return true

elseif item.itemid == 1945 and math.random(0, 8) == 6 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

addEvent(doCreateItem, 1000, 6556, 1, pos2)

addEvent(doCreateItem, 2000, 6557, 1, pos3)

doCreateItem(6557,1,pos1)

return true

elseif item.itemid == 1945 and math.random(0, 8) == 7 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

addEvent(doCreateItem, 1000, 6557, 1, pos2)

addEvent(doCreateItem, 2000, 6556, 1, pos3)

doCreateItem(6557,1,pos1)

return true

elseif item.itemid == 1945 and math.random(0, 8) == 8 then

doTransformItem(item.uid,1946)

doPlayerRemoveMoney(cid,config.moneyneed)

addEvent(doCreateItem, 1000, 6556, 1, pos2)

addEvent(doCreateItem, 2000, 6557, 1, pos3)

doCreateItem(6556,1,pos1)

return true

 

end

item0 = getThingfromPos(pos1)

item1 = getThingfromPos(pos2)

item2 = getThingfromPos(pos3)

if item.itemid == 1946 then

doTransformItem(item.uid,1945)

if item0.itemid ~= 0 and item1.itemid ~= 0 and item2.itemid ~= 0 then

doRemoveItem(item0.uid,1)

doRemoveItem(item1.uid,1)

doRemoveItem(item2.uid,1)

end

else

doTransformItem(item.uid,1945)

end

return 1

end

 

OBS : O Script n e meu

Link para o comentário
https://xtibia.com/forum/topic/186226-ajuda-action-ca%C3%A7a-niquel-ajuda/#findComment-1260816
Compartilhar em outros sites

  • 0

Poxa esse é bom, mais se vc clicar 2 veses seguido na alavanca, o script buga :c

 

Queria que algum pudesse ver o meu, ele é perfeitinho, so falta arruma esse erro :(

 

Alguem da um HELP ai? :(

Editado por Flaah
Link para o comentário
https://xtibia.com/forum/topic/186226-ajuda-action-ca%C3%A7a-niquel-ajuda/#findComment-1260932
Compartilhar em outros sites

  • 0

--[[

Advanced Slot Machine

by EddyHavoc

]]--

 

--REQUIRED MONEY(gp) TO PLAY SLOT MACHINE

local money = 1

 

--MILISECONDS TO CHANGE FRUITS

local time = 200

 

--ITERATOR TIME TO STOP CHANGING FRUIT IF PLAYER DOESN'T (30 is like 7 seconds)

local limit = 30

 

--FRUITS THAT WILL RANDOMLY APPEAR AND SWITCH

local fruits = {1128,1129,1132,1133,1144,1148,1146,1152}

 

--PRIZES TABLES

local win = {

-- [{FRUIT.1,FRUIT.2,FRUIT.3} = {PRIZE,#PRIZE}]

--MIXED COMBOS

[{1144,1144,1144}] = {2160,2}, -- cherry-pumpkin-cherry

[{1152,1152,1152}] = {2160,1}, -- lemon-melon-lemon

--TRIPLE COMBOS

[{1128,1129,1132}] = {2152,10}, -- triple strawberry

[{1133,1144,1152}] = {2152,20}, -- triple mango

--ANY COMBOS

[{ANY,1128,1129}] = {2152,50}, -- double pumpkin right

[{1132,1133,ANY}] = {2152,50}, -- double pumpkin left

[{1144,ANY,1144}] = {2152,100}, -- pumpkin sides combo

[{ANY,1148,1148}] = {2152,40}, -- double cherry right

[{1152,1152,ANY}] = {2152,40}, -- double cherry left

}

 

--MESSAGES THAT RANDOMLY APPEAR WHEN PLAYER WINS

local messages = {'Bingo!','Lucky!','Jackpot!','Win!'}

 

--FRUITS ROWS

local p = { --[LEVER.UNIQUEID]

[6297] = {},[6298] = {},[6299] = {},[6300] = {}, --[6301] = {},

} --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED

for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT}

table.insert(p[6297],i,{x=865+(i-1),y=732,z=7,stackpos=1})

table.insert(p[6298],i,{x=95+(i-1),y=145,z=7,stackpos=1})

table.insert(p[6299],i,{x=99+(i-1),y=145,z=7,stackpos=1})

table.insert(p[6300],i,{x=103+(i-1),y=145,z=7,stackpos=1})

-- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1})

end

 

function verifyRow(cid, array, pos)

local result, prize = false, ''

for a, b in pairs(win) do

if getTileItemById(pos[1],a[1]).uid > 1 or a[1] == ANY then

if getTileItemById(pos[2],a[2]).uid > 1 or a[2] == ANY then

if getTileItemById(pos[3],a[3]).uid > 1 or a[3] == ANY then

doPlayerAddItem(cid, b[1], b[2] or 1, true)

doSendAnimatedText(getThingPos(cid), messages[math.random(#messages)], math.random(255))

result, prize, amount = true, b[1], b[2]

end

end

end

end

if prize ~= '' then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won '..amount..' '..getItemPluralNameById(prize)..'!')

end

for i = 1,3 do

doSendMagicEffect(pos, result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)

doRemoveItem(getTileThingByPos(pos).uid)

end

return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine :( Try again')

end

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

local function doFruit(pos,cid,id,limit)

if not isPlayer(cid) then

return doItemEraseAttribute(item.uid, 'aid'), getTileThingByPos(pos).uid > 0 and doRemoveItem(getTileThingByPos(pos).uid)

end

if getTileThingByPos(pos).itemid < 1 then

doSendMagicEffect(pos, CONST_ME_POFF)

doCreateItem(fruits[math.random(#fruits)], 1, pos)

else

doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)

end

if limit <= 0 then

doSendMagicEffect(pos,math.random(28,30))

doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)

doItemSetAttribute(getTileThingByPos(fromPosition).uid, 'aid', getTileThingByPos(fromPosition).actionid+1)

doTransformItem(getTileThingByPos(fromPosition).uid , getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826)

elseif getTileThingByPos(fromPosition).actionid > id then

doSendMagicEffect(pos,math.random(28,30))

doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)

else

addEvent(doFruit,time,pos,cid,id,limit-1)

end

end

 

if item.actionid == 0 then

if not doPlayerRemoveMoney(cid, money) then

return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need '..money..' gps to play Slot Machine.')

end

doItemSetAttribute(item.uid, 'aid', 1)

doCreatureSetNoMove(cid, true)

doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)

doSendAnimatedText(getThingPos(cid), '-$'..money,COLOR_RED)

for i = 1,3 do doFruit(p[item.uid],cid,i,i*limit) end

elseif isInArray({1,2,3},item.actionid) then

doItemSetAttribute(item.uid, 'aid', item.actionid+1)

doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)

elseif item.actionid == 4 then

doCreatureSetNoMove(cid, false)

doItemEraseAttribute(item.uid, 'aid')

doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)

verifyRow(cid, win, p[item.uid])

end

return true

end

Link para o comentário
https://xtibia.com/forum/topic/186226-ajuda-action-ca%C3%A7a-niquel-ajuda/#findComment-1261177
Compartilhar em outros sites

  • 0

:o Funciono *----------*

 

+REP com toda a certeza :DD

 

Obrigado amigo *--*

 

Podem fechar o topico, e obrigado XTIBIA, o forum de vcs são fhoda KKKKKKKK' :D

 

Boa Noite a Todos *-*

Editado por Flaah
Link para o comentário
https://xtibia.com/forum/topic/186226-ajuda-action-ca%C3%A7a-niquel-ajuda/#findComment-1261428
Compartilhar em outros sites

×
×
  • Criar Novo...