Hi everyone. I was trying to script a LUA that would make a game object(portal) activate when a specific quest is completed. Does anyone know how to make a script like that?
Hi everyone. I was trying to script a LUA that would make a game object(portal) activate when a specific quest is completed. Does anyone know how to make a script like that?
You only need to insert your QUESTID and the GO ID.Code:function QuestPortal_OnUse(Unit, Event, player) if player:HasFinishedQuest(QUESTID)== true then player:Teleport(mapid, x, y, z) else player:SendBroadcastMessage("Before you can use the portal you need to finish the quest:'QUESTNAME'.") end end RegisterGameObjectEvent(GAMOBJECTID, 4, "QuestPortal_OnUse")
Thanks a lot =)
how bout if i want to make game object spawn when you except quest.
then edit this line
player:HasFinishedQuest(QUESTID)== true then
has quest i think
player:HasQuest(QUESTID)== true then
uhh how come when i press on the portal it casts that World of Recall(OLD) thing and it doesn't do anything afterwards?
Any error in the world.exe? If not try this:
Code:function QuestPortal_OnUse(pUnit, Event, player) if player:HasFinishedQuest(QUESTID)== true then player:Teleport(mapid, x, y, z) else player:SendBroadcastMessage("Before you can use the portal you need to finish the quest:'QUESTNAME'.") end end RegisterGameObjectEvent(GAMOBJECTID, 2, "QuestPortal_OnUse")
Try to change the 4 to a 2....
If this doesnt work i could make it as a npc (the npc would like look a portal)
Last edited by Kaidos; 08-13-2009 at 12:48 PM.
lol why did you say 4 the first time? go back and edit it.
still doesn't work
what's up with the World Recall spell anyways?
Most likely your gameobject isnt registered with a spell >_> Gogo to Database.. it's easier to edit it through the DB Tho you wont have as much possibilitys you have with LUA