Jump to content

[LE] Please help me create a script


gbcsi88

Recommended Posts

Not sure what you have as of yet but to remove an item like gold you would do something like...

 

Define a MiscItem property to reference the gold item.

 

Event Oneffectstart

Targetref.RemoveItem GoldProperty 1

EndEvent

 

I'm not sure if that will continuously drain gold as you hold it, so you might need a different event, but that's in a rudimentary version something close to what I imagine you're looking for.

Link to comment
Share on other sites

fire and forget spell script

 

tried applying it to concentration spells, but only gold was consumed during the first cast..

Because Google translation is crappy english :(

 

 

Event OnEffectStart(actor Target, actor Caster)

 

if Game.Getplayer().GetitemCount(gold001) <= 1

 

Game.Getplayer().Unequipspell(Myspell, 0)

Game.Getplayer().Unequipspell(Myspell, 1)

Debug.Notification("no Gold")

endif

endEvent

 

if akSpell == Myspell

if Game.Getplayer().GetitemCount(Gold001) > 1

Game.Getplayer().Removeitem(Gold001, 1, ture)

else

Game.Getplayer().removeitem(Gold001, 1, ture)

Game.Getplayer().UnequipSpell(Myspell, 0)

Game.Getplayer().UnequipSpell(Myspell, 1)

Debug.Notification(:no Gold")

endif

endif

endEvent

Link to comment
Share on other sites

Does the magic effect start immediately? If so can you use something like this?

if (Game.Getplayer().HasMagicEffect(MagicEffectProp)
Game.Getplayer().RemoveItem(GoldProp, 1, true)
utility.wait(1.0)

endif

That should work if the script loops. utility.wait changes with framerate though, so using realtime might be better.

Link to comment
Share on other sites

missing EOF at 'if'

no output generated for Goldcostsetspell, compilation failed

 

fail... :sad:

 

 

scriptname Goldcostsetspell

 

miscObject property Gold001 Auto

 

MagicEffect property SetEffect Auto

 

if Game.Getplayer().HasMagicEffect(SetEffect)

Game.Getplayer().removeitem(Gold001, 1, ture)

utility.wait(1.0

 

endif

Link to comment
Share on other sites

Also make sure you run it inside an event or function. The compiler should also give you the line number for the fail. I think it says line 3, 5 or something like that. If the statement isn't inside an event or function and the rest of the script is correct, the script will fail instantly and give back EOF error.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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