Imrinfected Posted February 2, 2010 Share Posted February 2, 2010 Scriptname OCNewdoorscriptbegin OnActivateendifendbegin gamemodeif GetDistance Player << 80 && ( GetCurrentTime ) >= 20 || ( GetCurrentTime ) << 4activateelseif GetDistance Player >> 80 && ( GetCurrentTime ) >= 20 || ( GetCurrentTime ) << 4activateelseif ( player.getcrimegold ) >= 500lock 100elseif ( player.getcrimegold ) <= 500 && ( getlocked ) == 1unlockendifEnd Script type is Object, and the script is attached to a door. No matter what, it won't work. I actually reduced it to Scriptname OCNewdoorscriptbegin gamemodeactivateendifEnd And it STILL wouldn't work. Does anyone happen to know what I'm doing wrong? Link to comment Share on other sites More sharing options...
LFact Posted February 2, 2010 Share Posted February 2, 2010 endif without if? Link to comment Share on other sites More sharing options...
Argomirr Posted February 2, 2010 Share Posted February 2, 2010 LFact is right about the missing "If", and it's "<", not "<<". It would help if you explained what you are trying to accomplish, and where it's going wrong; is the compiler refusing to compile it, or isn't it working in game? Link to comment Share on other sites More sharing options...
SrJoben Posted February 2, 2010 Share Posted February 2, 2010 Why did you write a script that does something if the player is more then 80 away AND less than 80 away? Do you really want it to not activate only if they are EXACTLY 80 units away? :huh: lol we really need to know what this is supposed to do, i can't make head or tail of it. Link to comment Share on other sites More sharing options...
Imrinfected Posted February 3, 2010 Author Share Posted February 3, 2010 I rewrote the script, and now it does more things.. But it still doesn't work. scn OCNewdoorscriptBrumashort Criminalref ActivatingNPCbegin onactivateset ActivatingNPC to getactionrefif player.isactordetected == 1 && player.getcrimegold >= 500 && ( ActivatingNPC.getdistance player ) < 120set Criminal to 1else set Criminal to 0elseif player.isactordetected == 1 && player.getcrimegold >= 500 && ActivatingNPC == playerset Criminal to 1else set Criminal to 0endifif ( GetCurrentTime ) > 20 && ( GetCurrentTime ) < 4 && Criminal == 0 && ActivatingNPC.GetIsReference player == 0 || BrumaHouseForSale.isowner == 1activateelseelseif ( GetCurrentTime ) <= 20 && ( GetCurrentTime ) >= 4 && Criminal == 0activateelseendifend I'm putting in on every city gate door in Open Cities to make it only open at night if the player owns a home in that city. I have a script for each city, each one attached to the appropriate city door. If the player does not own a home, the door stays closed at night, and cannot be lockpicked. NPCs activating the door cannot open it if the player has a bounty over 500 gold, and the player is within 120 of that npc. This way the doors are more appropriate, keeping out(Or in) criminals. I still have to give it a timer so that the doors automatically close after being opened, but that's rather simple. I'm trying to get this script to work first. Can anyone tell my why it won't work? Link to comment Share on other sites More sharing options...
Recommended Posts