Stormoguden
Professional Mapper~
Okay, I need some help with 2 scripts thats pretty important for a big quest on my server..
First off I got this:
Basicly, you use a item and gets teleported to another place, the item can be used from 3 diffrent squaremeters so 1 for each.
The script works, the problem is I get this error every time I use the item with UID 1051
So I just want to get no error, the script works but it's very annoying with this error
___________________________________________________________
Script 2:
Pull the lever, cask moves 1 sqm down for 10 secs then gets back.
This is the script I made for it
This script I just cant get working, I'm very bad scripter so thats probably why, but if anyone can help me with this script rep++ straight! With the first one also!
All help apprieciated! THANKS
First off I got this:
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 1051 and item.itemid == 3678 then
local player1pos = {x=1049, y=1206, z=5, stackpos=253}
local player2pos = {x=1050, y=1206, z=5, stackpos=253}
local player3pos = {x=1051, y=1206, z=5, stackpos=253}
local player1 = getThingfromPos(player1pos)
local player2 = getThingfromPos(player2pos)
local player3 = getThingfromPos(player3pos)
local nplayer1pos = {x=1050, y=1205, z=3, stackpos=253} --- where player 1 will be teleported
local nplayer2pos = {x=1050, y=1205, z=3, stackpos=253} --- where player 2 will be teleported
local nplayer3pos = {x=1050, y=1205, z=3, stackpos=253} --- where player 3 will be teleported
doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)
doTeleportThing(player3.uid,nplayer3pos)
end
end
The script works, the problem is I get this error every time I use the item with UID 1051
Code:
[07/08/2009 17:51:47] Lua Script Error: [Action Interface]
[07/08/2009 17:51:47] data/actions/scripts/skorstenen.lua:onUse
[07/08/2009 17:51:47] luaDoTeleportThing(). Thing not found
___________________________________________________________
Script 2:
Pull the lever, cask moves 1 sqm down for 10 secs then gets back.
This is the script I made for it
Code:
local stonepos1 = {x=1053, y=1204, z=7} -- Position of the stone to remove
local stonepos2 = {x=1054, y=1204, z=7} -- Position of the stone to remove
local stonepos3 = {x=1053, y=1205, z=7} -- Position of the stone to remove
local stonepos4 = {x=1054, y=1205, z=7} -- Position of the stone to remove
local stonepos5 = {x=1053, y=1206, z=7} -- Position of the stone to remove
local stonepos6 = {x=1054, y=1206, z=7} -- Position of the stone to remove
local LeverPos = { x = 1048, y = 1206, z = 7} -- Position of the lever
local timer = 10 -- Seconds to remove teleport and replace stone
function onUse(cid, item, frompos, item2, topos)
local stone1 = getTileItemById(stonepos1, 1778) -- Item1 to remove
local stone2 = getTileItemById(stonepos2, 1779) -- Item2 to remove
local stone3 = getTileItemById(stonepos3, 1780) -- Item3 to remove
local stone4 = getTileItemById(stonepos4, 1781) -- Item4 to remove
local stone5 = getTileItemById(stonepos5, 1780) -- Item1 to remove
local stone6 = getTileItemById(stonepos6, 1781) -- Item2 to remove
if item.itemid == 1945 then
doRemoveItem(stonepos1.uid, 1)
doRemoveItem(stonepos2.uid, 1)
doRemoveItem(stonepos3.uid, 1)
doRemoveItem(stonepos4.uid, 1)
doCreateItem(1778, 1, stonepos3)
doCreateItem(1779, 1, stonepos4)
doCreateItem(1780, 1, stonepos5)
doCreateItem(1781, 1, stonepos6)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have ".. timer .." seconds to enter the secret passage.")
addEvent(doRemovestone3, timer * 1000)
addEvent(doRemovestone4, timer * 1000)
addEvent(doRemovestone5, timer * 1000)
addEvent(doRemovestone6, timer * 1000)
doCreateItem(1778, stonepos1)
doCreateItem(1779, stonepos2)
doCreateItem(1780, stonepos3)
doCreateItem(1781, stonepos4)
end
end
end
function doRemovestone3()
local stone3 = getTileItemById(stonepos3, 1780)
local lever = getTileItemById(LeverPos, 1946)
if stone3.uid > 0 then
doRemoveItem(1780, 1, stonepos3)
doSendMagicEffect(TeleportPos, CONST_ME_POFF)
end
function doRemovestone4()
local stone4 = getTileItemById(stonepos4, 1781)
local lever = getTileItemById(LeverPos, 1946)
if stone4.uid > 0 then
doRemoveItem(1781, 1, stonepos4)
doSendMagicEffect(TeleportPos, CONST_ME_POFF)
end
function doRemovestone5()
local stone5 = getTileItemById(stonepos5, 1780)
local lever = getTileItemById(LeverPos, 1946)
if stone5.uid > 0 then
doCreateItem(1778, 1, stonepos3)
doSendMagicEffect(TeleportPos, CONST_ME_POFF)
end
function doRemovestone6()
local stone6 = getTileItemById(stonepos6, 1781)
local lever = getTileItemById(LeverPos, 1946)
if stone6.uid > 0 then
doCreateItem(1779, 1, stonepos4)
doSendMagicEffect(TeleportPos, CONST_ME_POFF)
end
end
This script I just cant get working, I'm very bad scripter so thats probably why, but if anyone can help me with this script rep++ straight! With the first one also!
All help apprieciated! THANKS