Jump to content

Help with another script?


Imrinfected

Recommended Posts

Scriptname OCNewdoorscript

begin OnActivate

endif

end

begin gamemode

if GetDistance Player << 80 && ( GetCurrentTime ) >= 20 || ( GetCurrentTime ) << 4

activate

elseif GetDistance Player >> 80 && ( GetCurrentTime ) >= 20 || ( GetCurrentTime ) << 4

activate

elseif ( player.getcrimegold ) >= 500

lock 100

elseif ( player.getcrimegold ) <= 500 && ( getlocked ) == 1

unlock

endif

End

 

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 OCNewdoorscript

begin gamemode

activate

endif

End

 

And it STILL wouldn't work.

 

Does anyone happen to know what I'm doing wrong?

Link to comment
Share on other sites

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

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

I rewrote the script, and now it does more things.. But it still doesn't work.

 

scn OCNewdoorscriptBruma

short Criminal

ref ActivatingNPC

begin onactivate

set ActivatingNPC to getactionref

if player.isactordetected == 1 && player.getcrimegold >= 500 && ( ActivatingNPC.getdistance player ) < 120

set Criminal to 1

else set Criminal to 0

elseif player.isactordetected == 1 && player.getcrimegold >= 500 && ActivatingNPC == player

set Criminal to 1

else set Criminal to 0

endif

if ( GetCurrentTime ) > 20 && ( GetCurrentTime ) < 4 && Criminal == 0 && ActivatingNPC.GetIsReference player == 0 || BrumaHouseForSale.isowner == 1

activate

else

elseif ( GetCurrentTime ) <= 20 && ( GetCurrentTime ) >= 4 && Criminal == 0

activate

else

endif

end

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...