I need help to find out why this is not working!
Im using TFS 0.2.7 if thats for any help.
Quest.lua
I dont need both actions, but I could not find anything better.
So if you need you can remove this part:
Actions.xml
Errors when reloading actions.
No errors when pressing the door.
This is the settings of the door.
Ofc I will Rep++ You if you help, Thanks for your time.
Yours DanneZ.
Im using TFS 0.2.7 if thats for any help.
Quest.lua
Orginal Post: Add two actions - Nacke Postlocal teleportItems = {
[13379] = {
position = {x=857, y=724, z=6},
backPosition = {x=857, y=722, z=6},
message = "Welcome to the Quest, you only have 20 minutes."},
backMessage = "You were too slow, try again!"},
timer = 10 * 60 * 1000
},
[1001] =
position = {x=100, y=100, z=7},
backPosition = {x=100, y=100, z=7},
message = "Welcome somewhere!"},
backMessage = "Your visit has been finished!"},
timer = 30 * 60 * 1000
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local teleport = teleportItems[item.uid]
if(not teleport) then
return FALSE
end
doTeleportThing(cid, teleport.position)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
if(teleport.message) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, teleport.message)
end
if(teleport.timer) then
addEvent(teleportBack, teleport.timer, cid, item.uid)
end
return TRUE
end
function teleportBack(cid, id)
if(isPlayer(cid) == FALSE) then
return
end
local teleport = teleportItems[id]
doTeleportThing(cid, teleport.position)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
if(teleport.backMessage) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, teleport.backMessage)
end
end
I dont need both actions, but I could not find anything better.
So if you need you can remove this part:
[1001] =
position = {x=100, y=100, z=7},
backPosition = {x=100, y=100, z=7},
message = "Welcome somewhere!"},
backMessage = "Your visit has been finished!"},
timer = 30 * 60 * 1000
}
Actions.xml
<action itemid="13379" script="Quest.lua"/>
Errors when reloading actions.
[21/01/2011 12:06:12] Warning: [Event::checkScript] Can not load script. /scripts/Quest.lua
[21/01/2011 12:06:12] data/actions/scripts/Quest.lua:7: unexpected symbol near '='
No errors when pressing the door.
This is the settings of the door.
Ofc I will Rep++ You if you help, Thanks for your time.
Yours DanneZ.