Jump to content

A Papyrus Script to Toggle a Designated Effect


Altrunchen

Recommended Posts

So what I'm trying to do is make a script that allows a player to use an activator in game so as to enable or disable an effect that is linked in some way to the activator. I would really appreciate it if someone would please help me with this.

 

Here is my attempt so far:

 

Scriptname FXToggleSwitch extends ObjectReference

{This is to allow effects to be toggled in game with activators.}

 

ObjectReference function Switch

ObjectReference function Effect

Int Property Duration

 

Event OnActivate(ObjectReference Switch)

Effect.enable (duration)

Endevent

 

Here are the error messages:

 

Starting 1 compile threads for 1 files...

Compiling "FXToggleSwitch"...

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FXToggleSwitch.psc(4,31): mismatched input '\\r\\n' expecting LPAREN

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FXToggleSwitch.psc(0,0): error while attempting to read script FXToggleSwitch: Object reference not set to an instance of an object.

No output generated for FXToggleSwitch, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on FXToggleSwitch

Link to comment
Share on other sites

You really need to read some scripting tutorials...

 

Scriptname FXToggleSwitch extends ObjectReference
{This is to allow effects to be toggled in game with activators.}

ObjectReference Property Effect Auto
Int Property Duration Auto

Event OnActivate(ObjectReference akActionRef)
Effect.Enable()
Utility.Wait(Duration)
Effect.Disable()
Endevent

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...