Jump to content

[LE] Need help with a simple polymorph script


morogoth35

Recommended Posts

Hi guys I am trying to make a simple polymorph spell but I get a compiler error with the script and I hope you might know what is wrong with it.

 

Here is the script:

Scriptname PolymorphScript extends ActiveMagicEffect

Race Property PolymorphRace Auto

String DefaultRace

Event OnEffectStart(Actor akTarget, Actor akCaster)

	If (akTarget.GetActorBase().GetRace() != PolymorphRace)
	Debug.Notification("The spell hit the target.")
	DefaultRace = akTarget.GetRace()
	akTarget.SetRace(PolymorphRace)
	EndIf
	
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
	
	Debug.Notification("Target was returned to its default race.")
	akTarget.SetRace(DefaultRace)

EndEvent

Here is the compiler error:

 

(20,10): type mismatch on parameter 1 (did you forget a cast?)

Edited by morogoth35
Link to comment
Share on other sites

  • Recently Browsing   0 members

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