Jump to content

Photo

Please help me create a script

script gold help

  • Please log in to reply
17 replies to this topic

#1
gbcsi88

gbcsi88

    Stranger

  • Members
  • Pip
  • 8 posts

hello all

 

i can not speak english well, please understand

 

i want a gold consumption script per second

used for concentration spell..

 

i can not make it out of my ability

 

 

i very want it. please...

 



#2
SeraphimKensai

SeraphimKensai

    Have you all seen my keys? I think they are here somewhere.

  • Members
  • PipPipPip
  • 560 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.

#3
gbcsi88

gbcsi88

    Stranger

  • Members
  • Pip
  • 8 posts

i applied it but failed..



#4
SeraphimKensai

SeraphimKensai

    Have you all seen my keys? I think they are here somewhere.

  • Members
  • PipPipPip
  • 560 posts
Post what you have of your script so far and I'll take a look at it.

#5
gbcsi88

gbcsi88

    Stranger

  • Members
  • Pip
  • 8 posts

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



#6
curecuriosity

curecuriosity

    Newbie

  • Members
  • Pip
  • 10 posts

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. 



#7
gbcsi88

gbcsi88

    Stranger

  • Members
  • Pip
  • 8 posts

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



#8
SeraphimKensai

SeraphimKensai

    Have you all seen my keys? I think they are here somewhere.

  • Members
  • PipPipPip
  • 560 posts
The utility wait you just posted isn't enclosed, that could be causing issues with compiling.

#9
curecuriosity

curecuriosity

    Newbie

  • Members
  • Pip
  • 10 posts

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. 



#10
gbcsi88

gbcsi88

    Stranger

  • Members
  • Pip
  • 8 posts

i do not get what it means.. Google translation f***...

 

i do not know the script, and the above script was done by someone else. sorry







Also tagged with one or more of these keywords: script, gold, help

Page loaded in: 1.065 seconds