I came up with this script while i was building my Mod, not sure if there is any others out there that have this or not. It is a script that allows a PC to use a placeable as a port to another location designated by the WP_ tag and uses a key tag to use the placeable, if no key then can't port. As for the wp_ tag you will need to change that for your specific wp_, and not use mine, unles you want to create a wp_ with that tag on it. Now for the object just take the object you want to use and put that tag in place of the one i have and it will work perfect everytime.
Ok there is an updated file took out the (oTarget) as yes not needed, it only needed to unlock the placeable object with the key, it was created for a seceret order on my Mod, and only used for certain players, but i guess it could be used for other applications as well.
Well as for the WP_ tag it is one that i use it is to be changed to the WP_ tag you designate. The huminoidcage is the placable object that i use in my Mod also needs to be changed to the oject tag you want to use, sorry i guess i should put that in the description. I know you can use it for multiple keys but this script is made for each of my players specifically with thier own key, asked for by them. Thank you for the vote and comments, i will clarify in the description, better. Thank you all
Posted by Saduj at 2009-09-30 00:52:55 Voted 10.00 on 09/30/09
Here's a version of same idea, that checks for multiple keys, and has var for Locked feedback, as well as a default const string ...
Feel free to use or modify as you wish :)
// Script keyed_portal.nss
//
// Notes:
// Portal with optional multiple keys.
// Teleports to "WP_" + Tag of calling object.
// Checks for local string vars "KEY1" "KEY2" "KEY3" etc...
// If key string exisits, but item not found,
// calling object says string var LOCKED or const sLocked.
// If KEY1 not specified then functions as a normal portal.
const string sLocked = "*Locked*";
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oTargetWP=GetWaypointByTag("WP_"+GetTag(OBJECT_SELF));
if (oTargetWP==OBJECT_INVALID) return;