Why don't you look at the existing forges?
CraftingBlacksmithForgeSTATIC is an activator it has two scripts BlacksmithForge01 is the one you want to have a closer look at (doubleclick on it)
scriptName BlacksmithForge01 extends ObjectReferenceimport Debugspell property FlameDamage AutoEVENT onActivate ( objectReference triggerRef ) playAnimation("activate")endEventEvent OnTriggerEnter ( objectReference triggerRef ) if (triggerRef == Game.GetPlayer()) FlameDamage.Cast(triggerRef, triggerRef) endIfendEventThat's no rocket science is it? one event starts when anyone activates the forge, the other when the player stands upon it.
The second script is a bit trickier:
event onActivate(objectReference akActivator); debug.Trace(self + " has been activated by " + akActivator);Actor is attempting to mineif akActivator as actor ;if the actor is the player if akActivator == game.getPlayer() ;if this is not depleted and the player has the right item if requiresTool && playerHasTools() == false FailureMessage.Show() ;enter the furniture else; debug.Trace(self + " should cause " + akActivator + " to activate " + getLinkedRef()) if getLinkedRef() getLinkedRef().activate(akActivator) AchievementsQuest.incHardworker(2) Else; debug.Trace(self + ": error this ore does not have a linkedRef") endif endif Else if getLinkedRef() getLinkedRef().activate(akActivator) Else; debug.Trace(self + ": error this ore does not have a linkedRef") endif EndIf;Something unexpected has activated the oreElse; debug.Trace(self + "has been activated by: " + akActivator + " why?")endifendEvent
Here you replace
if akActivator == game.getPlayer() with
if akActivator == game.getPlayer() && PlayerGotPermission.GetValue() == 1Seems like gamesas originally intended that wee need to carry tools to use the forge, you could also use this for your needs by hijacking the code and replacing
if requiresTool && playerHasTools() == false with
if PlayerGotPermission.GetValue() != 1 and then modify the message. Or you could add a new if-block with your condition that displays a different message when the player has no permission.
Nobody's going to make your mod for you, my new onactivate event above starts the event only if the user isn't the player or when the global variable is set, the changed line for the second scripts adds the new condition that the variable has to be set when the player uses the forge. Your task now is to improve on those scriplets and adapt them to your needs.
Start here to learn scripting: http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Hello_World