Key Script Help?

I need help making a key script. On Xoria I've seen you need the thief's key to get to opening up the tree, but is there a way to make it open to those who are in the same level when only one player gets the key?

If I get a key and open the door, how can it will open to the others in the same level?

Re: Key Script Help?

I've got something like this for the playerhouses on my server. Each player's house will have a key to it inside.

The script uses the key as a toggle. It sets a flag for so long and then turns off. When the user touches the door while the flag is on, the door opens for all players. This way, the owner can restrict who's allowed in the house.

You can use that idea to tweak the door to your tree. Only, instead of just making the door disappear, you could make it change to an image of an opened door. This would allow all players on the field to enter.

Key Script

// NPC made by Koroshiya // Key Script for Gabe if (playertouchsme) { toweapons Thieves' Key; } if (weaponfired) { set keythieves; setplayerprop #c,Thieves key activated; sleep 10; unset keythieves; }

Door Script

// NPC made by Koroshiya // Door Script for Gabe if (created) { setimg door_closed.png; } if (playertouchsme&&keythieves) { setimg door_open.png; sleep 20; setimg door_closed.png; }

Notes:
Using a weaponfired flag makes it so you don't have to worry about timeouts screwing up. Firing the weapon sets the key flag and sleeps for 10 before unsetting.

The door script is set to be closed by default. And after being opened, sleeps for 20 and then closes again. Replace door_open.png and door_closed.png with the door images appropriate to your project.

Re: Key Script Help?

Bravo mate, thanks. I'll test it out later. I ned to get around to it.

Re: Key Script Help?

It's wicked simple. But, it should get the job done.

Re: Key Script Help?

yes. Before hand I saw an NPC item script, and I thought htats how it could be done, but I'm not much of a scripter. I'm learning very quickly in the basics.

Re: Key Script Help?

I didn't really care much for math through High School, so I screwed myself over when I started getting into gScript. I really enjoy scripting, but I can only do extremely simple things.