TheSKPwningest1992 Posted January 20, 2012 Share Posted January 20, 2012 Hi. I'm not very good with scripting so could someone lend me a hand making a script? I need one for a door that will only open to people with a level of at least 10, and message box appearing if the player is below the required level. If it works and I get around to uploading the mod, you will be credited. P.S. I'm not sure if this is the correct section for this request, if it is not, could you indicate which section it needs to be moved to? Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted January 20, 2012 Share Posted January 20, 2012 (edited) Not exactly a request for a mod, but I digress. Basically you need to put an Object Script onto the door with code similar to the following: Begin OnActivate player if player.GetLevel >= 10 Activate player else MessageBox "You can only open this door at a level of at least 10!" endif End Looks pretty simple and straight-forward. - The OnActivate block gets executed when someone tries to activate the object, in this case it's limited to when the player activates it only.- Inside an OnActivate block you always have to call Activate, if you want it to activate ever again, or it will always only execute the script and never open.- So I simply put this Activate call inside a quick level check for the player. The call works on the object the script is running on and passes who is activating it through the parameter. (People often confuse this with activating the object passed, so "Activate player" does not mean activating the player, nor does "kill player" kill the player. Both are the same as "self.Activate player", "self" only being to represent the reference, so it's itself which gets activated/killed and "player" is only passed so the statistics know it's a kill counting to the player and such things.) I hope it works. (no credits necessary, it's way too simple) Edited January 20, 2012 by DrakeTheDragon Link to comment Share on other sites More sharing options...
TheSKPwningest1992 Posted January 21, 2012 Author Share Posted January 21, 2012 Thanks man =) Link to comment Share on other sites More sharing options...
Recommended Posts