Jump to content

Why won't this script save?


ThaLuuksta

Recommended Posts

Since the NV geck won't check the scripts, i don't know what is wrong.

 

scn Companion001Script ;Name of the script. Change to something you want

 

short Follow ;Is it on Follow

short Stay ;Is it on Stay

short Activated ;For use with the buttons

short Button ;Same as above

short IsSneak ;Get is in Sneak

ref self ;Itself

 

Begin OnLoad

 

set self to GetSelf ;Set the Reference to what you placed this on.

SetIgnoreFriendlyHits 1 ;Does it ignore Friendly Hits? Default yes

 

End

 

Begin OnActivate ;When you 'talk' to it

 

If self.GetDead == 0 ;If it isnt dead, proceed

If IsActionRef Player == 1 ;Is the person or object 'talking' to it is player, proceed

ShowMessage Companion001 ;Show this message box.

Set Activated to 1 ;Sets 'used' state so it will not repeat

EndIf

 

; OPTIONAL if you want them to know if the pet is unconcious

 

elseif self.GetUnconscious == 1 ;Is the person or object is Unconcious ( Essentials )

ShowMessage Companion001Unconscious

 

; END OPTIONAL

 

; NOTE: The below only works if you DON'T want your companion to be 'immortal' aka cannot die.

elseif self.GetDead == 1 ;If the above failed to check, is the this ref dead? If so proceed, if not next statement.

Activate

 

 

Endif

End

 

; OPTIONAL for Companion being hit by the Player

Begin OnHit Player ;if you shot it or hit it with anything

 

If Follow == 1 || Stay == 1 ;checks to see if its a teammate to you. if not this wont go.

ShowMessage Companion001Hit ;the message to show when it is hit. optional. delete this if you want.

Endif

 

End

; END OPTIONAL

 

 

Begin GameMode

 

if GetPlayerTeammate == 0 ;Loops each time it is not a Teammate. ( Avoids some bugs like them attacking passives etc without being provoked.

SetPlayerTeammate 1

endif

 

If Activated == 1 ; Do NOT touch unless you know what you are doing. Only edit the commented lines.

set Button to GetButtonPressed

if Button > -1

set Activated to 0

if Button == 0

Set Follow to 1

Set Stay to 0

 

;OPTIONAL for the Map Marker

 

If IsInInterior == 0

Companion001MM.disable ;Change Companion001MM to your Map Marker REF

Endif

 

; END OPTIONAL

 

evp

set Activated to 0

elseif Button == 1

Set Stay to 1

Set Follow to 0

 

;OPTIONAL for the Map Marker

 

If IsInInterior == 0

Companion001MM.MoveTo player ;Change Companion001MM to your Map Marker REF

Companion001MM.enable ;Change Companion001MM to your Map Marker REF

Endif

 

; END OPTIONAL

 

evp

set Activated to 0

elseif Button == 2

If Follow == 1

OpenTeammateContainer

else

ShowMessage Companion001NoFollow ;Change to your NoFollow message.

evp

set Activated to 0

endif

endif

endif

endif

 

If Follow == 1 && self.GetUnconscious == 0 && self.GetDead == 0

 

If Player.IsSneaking == 1 && IsSneak == 0

Set IsSneak to 1

evp

elseif Player.IsSneaking == 0 && IsSneak == 1

Set IsSneak to 0

evp

endif

 

If Self.GetDistance Player >= 5000 ; Just in case it gets lost.

Self.MoveTo Player

Endif

 

Endif

 

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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