Canderis Posted December 1, 2008 Share Posted December 1, 2008 Again ive needed to ask for help on scripting. The script ive made dosent work. It wont compile. Can you guys see the error? void main() { object oEntering = GetEnteringObject(); object oPC=GetFirstPC(); if (GetIsPC(oEntering)) { //check if the object is already there to avoid multiple objects if (!GetIsObjectValid(GetObjectByTag("o"))) { CreateObject(OBJECT_TYPE_PLACEABLE, "hawkx", Location(Vector(58.25,50.77,1.80),3.04)); ExecuteScript("old_k_003ebo_enter", OBJECT_SELF); } do you guys see anything wrong with it? Link to comment Share on other sites More sharing options...
Det. Bart Lasiter Posted December 1, 2008 Share Posted December 1, 2008 You left out some closing braces. void main() { // <1> object oEntering = GetEnteringObject(); object oPC = GetFirstPC(); if(GetIsPC(oEntering) && !(GetIsObjectValid(GetObjectByTag("o")))) { // <2> CreateObject(OBJECT_TYPE_PLACEABLE, "hawkx", Location(Vector(58.25, 50.77, 1.80), 3.04)); ExecuteScript("old_k_003ebo_enter", OBJECT_SELF); } // </2> } // </1> Link to comment Share on other sites More sharing options...
Canderis Posted December 1, 2008 Author Share Posted December 1, 2008 Thanks it worked! One last script question: What would I need to add to that script to check to see if the object is already there? This is an on enter script so i need to make it so that it dosent appear every time I enter the ebon hawk. How would I do that? Link to comment Share on other sites More sharing options...
Star Admiral Posted December 1, 2008 Share Posted December 1, 2008 void main() { object oEntering = GetEnteringObject(); object oPC = GetFirstPC(); if(GetIsPC(oEntering) && !(GetIsObjectValid(GetObjectByTag("hawkx")))) { CreateObject(OBJECT_TYPE_PLACEABLE, "hawkx", Location(Vector(58.25, 50.77, 1.80), 3.04)); } ExecuteScript("old_k_003ebo_enter", OBJECT_SELF); } Nothing new needs to be added to the script to check if the object is there, just replace the "o" in GetObjectByTag("o") with the tag of your placeable, as in the above example. Oh, and you should keep the ExecuteScript for the old onenter script outside the if statement, because you want to fire all the time, not just when the if statement is true. - Star Admiral Link to comment Share on other sites More sharing options...
Canderis Posted December 1, 2008 Author Share Posted December 1, 2008 Thanks Star Sdmiral! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.