randallrmz11
New Member
- Joined
- Sep 3, 2014
- Messages
- 12
- Reaction score
- 0
I am using this Action code to create a teleport when you pull a lever with id "1945" in "azerusdeath_in_position" with destination to "azerusdeath_to_position", the teleports creates and takes me to the position, but it doesn't remove in the specified time, and I get this error in console
The code is:
And I think the problem is :addEvent(removeTeleportInAzerusDeathWard, (1000*time_to_pass)) ---> Should be a function.... as the console says.....
But cuz I just know lua by my own experience(reading-comparing-copying scripts) I don't know how to solve it:C
And also I would like to "Lock" the lever at ID: 1946 --->When teleport is present, because at this moment it only sends a message this:
Thanks for the attention Otland Community.
The code is:
Code:
function onUse(cid, item, pos,topos, item2)
local azerusdeath_in_position = {x=32276, y=32241, z=7, stackpos=2}
local azerusdeath_to_position = {x=32281, y=32240, z=7, stackpos=1}
local getport = getThingfromPos({x=32276, y=32241, z=7, stackpos=1})
local time_to_pass = 5
local tpID = 5023
local doEffect = CONST_ME_ENERGYHIT
local message = "You have 5 seconds to use the teleport!"
if item.uid == 10334 and item.itemid == 1945 then
teleport = doCreateTeleport(tpID, azerusdeath_to_position, azerusdeath_in_position)
doSendMagicEffect(azerusdeath_in_position, CONST_ME_ENERGYHIT)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInAzerusDeathWard, (1000*time_to_pass))
elseif item.uid == 10334 and item.itemid == 1946 and getport.itemid == 5023 then
doPlayerSendCancel(cid,"You will have to wait until teleport disappears.")
end
function removeTeleportInAzerusDeath()
if getThingfromPos({x=32276, y=32241, z=7, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=32276, y=32241, z=7, stackpos=1}).uid,1)
doSendMagicEffect({x=32276, y=32241, z=7, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
end
And I think the problem is :addEvent(removeTeleportInAzerusDeathWard, (1000*time_to_pass)) ---> Should be a function.... as the console says.....
But cuz I just know lua by my own experience(reading-comparing-copying scripts) I don't know how to solve it:C
And also I would like to "Lock" the lever at ID: 1946 --->When teleport is present, because at this moment it only sends a message this:
Code:
elseif item.uid == 10334 and item.itemid == 1946 and getport.itemid == 5023 then
doPlayerSendCancel(cid,"You will have to wait until teleport disappears.")
Thanks for the attention Otland Community.