megachock
Member
- Joined
- Mar 12, 2009
- Messages
- 115
- Reaction score
- 7
Well i have made this script with a bit help from summ, now i tried to add some new functions and organize it on a table but i dont know why it dont works...
When 4 items is in a correct position this teleport you to a new position also the items came back to the position they was..
Im just new on scripting :/
UPDATE
I made the first table work but it dont send de message also the timer dont works
- - - Updated - - -
Help me pls :/
- - - Updated - - -
buump
When 4 items is in a correct position this teleport you to a new position also the items came back to the position they was..
Im just new on scripting :/
UPDATE
I made the first table work but it dont send de message also the timer dont works
Lua:
local red = {initalps = {x = 1912, y = 932, z = 10},
pos = {x = 1911, y = 935, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
items = 9976
}
local blue = {initalps = {x = 1912, y = 933, z = 10},
pos = {x = 1911, y = 932, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
items = 9977
}
local lightblue = {initalps = {x = 1912, y = 934, z = 10},
pos = {x = 1911, y = 934, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
items = 9978
}
local green = {initalps = {x = 1912, y = 935, z = 10},
pos = {x = 1911, y = 933, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
items = 9979
}
local event = 0
local pred = getThingFromPos(red.pos)
local pblue = getThingFromPos(blue.pos)
local plightblue = getThingFromPos(lightblue.pos)
local pgreen = getThingFromPos(green.pos)
local function reset(leverPos)
local lever = getTileItemById(leverPos, 1946).uid
doTransformItem(lever, 1945)
doRemoveItem(getTileItemById(pred,red.items).uid)
doRemoveItem(getTileItemById(pblue,blue.items).uid)
doRemoveItem(getTileItemById(plightblue,lightblue.items).uid)
doRemoveItem(getTileItemById(pgreen,green.items).uid)
doCreateItem(red.items, 1, red.initalps)
doCreateItem(blue.items, 1, blue.initialps)
doCreateItem(lightblue.items, 1, lightblue.initialps)
doCreateItem(green.items, 1, green.initialps)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if pred.itemid == red.items and pblue.itemid == blue.items and plightblue.itemid == lightblue.items and pgreen.itemid == green.items then
doTeleportThing(cid, {x = 1917, y = 934, z = 10})
doPlayerSendMessage(cid,21,"Nice calculation!")
event = addEvent(reset, 7 * 1000, getThingPos(item.uid))
doTransformItem(item.uid,item.itemid+1)
else
doPlayerSendCancel(cid, "The position of the items is wrong!")
end
return true
end
- - - Updated - - -
Help me pls :/
- - - Updated - - -
buump
Last edited: