Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
TomoAlien

Executing script only if player has a key.

Recommended Posts

I want to make a swich that lowers the lift with sector tag 2 only when player has a red skullkey. I don't know how to do it. Your help is appreciated.

EDIT:Okay, i made it by myself. Please lock this thread.

Share this post


Link to post
shinobi.cl said:

Then, post your solution :) It can help others. After all this thread will be queried by search engines sometime.


Okay, so there's the code:

script 1 (void)
{
        if (CheckInventory("Some_Key"))
            Place a action there.
        else
            print(s:"You need Some Key to use this thing.");
}
Instead of Some_Key you must type in:
RedSkull - Red Skull
BlueSkull - Blue Skull
YellowSkull - Yellow Skull
RedCard - Red Keycard
BlueCard - Blue Keycard
YellowCard - Yellow Keycard

I hope this post helps somebody.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×