foamyesque Posted September 6, 2018 Share Posted September 6, 2018 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. Everything that does something inside a script, with only the exception of declaring variables, has to be inside either an event or a function. Events are code blocks that listen for particular things that the game does and are the entry point for manipulating it with scripts. The OnMagicEffectStart in the code snippet of this post is an example of an event. It will fire whenever the magic effect starts being applied to the target. Functions are code blocks that can be reused without needing to re-write all the pieces of it. For example, RemoveItem() is an event. If your objective is to use a player's gold to cast something instead of, or in addition to, their magicka, there may be a better approach. I need to do some testing. Link to comment Share on other sites More sharing options...
curecuriosity Posted September 6, 2018 Share Posted September 6, 2018 Where are you from? Event HasMagicEffect(MagicEffect akEffect) IF Game.Getplayer().HasMagicEffekt(EffektProp)Game.Getplayer().RemoveItem(GoldProp, 1)Utility.Wait(1.0)EndIF EndEventIm a scripting noob so I'm not sure, but I'd start there. Link to comment Share on other sites More sharing options...
gbcsi88 Posted September 7, 2018 Author Share Posted September 7, 2018 from korea compilered success but, it does not apply to inGame... Gold is not consumed when using spells... :sad: Link to comment Share on other sites More sharing options...
curecuriosity Posted September 7, 2018 Share Posted September 7, 2018 Try this. (I only added lines to your first script, check for typos) Event OnEffectStart(actor Target, actor Caster) RegisterForSingleUpdate(1.0) EndEvent Event OnUpdate() IF Game.Getplayer().GetitemCount(gold001) <= 1 Game.Getplayer().Unequipspell(Myspell, 0) Game.Getplayer().Unequipspell(Myspell, 1) Debug.Notification("no Gold") ElseIf Game.Getplayer()GetItemCount(Gold001) > 1 Game.Getplayer()RemoveItem(Gold001, 1) RegisterForSingleUpdate(1.0) ENDIF ENDIF endEvent Event OnEffectFinish(Actor Target, Actor Caster) UnregisterForUpdate() EndEvent Link to comment Share on other sites More sharing options...
gbcsi88 Posted September 7, 2018 Author Share Posted September 7, 2018 fail... i do not know what i;m doing wrong.. i'm stupid :sad: Link to comment Share on other sites More sharing options...
curecuriosity Posted September 7, 2018 Share Posted September 7, 2018 (edited) See where it's ENDIF ENDIF? remove one of them. I'll look at the rest. Edited September 7, 2018 by curecuriosity Link to comment Share on other sites More sharing options...
SeraphimKensai Posted September 7, 2018 Share Posted September 7, 2018 It is probably also worth putting a "." after "Game.GetPlayer()" on both lines 25 & 26 before the GetItemCount and RemoveItem respectively. Link to comment Share on other sites More sharing options...
curecuriosity Posted September 7, 2018 Share Posted September 7, 2018 ^ Yes. Should work after those corrections.A few problems; The HasMagicEffect event is not needed anymore.Line 25 doesn't need the Elseif i don't think. Using "Else" instead and removing the contents of that line would do the same, but be more efficient. (my bad)The way it is now, if we ignore the first event, the script will run for 1 second when you cast without checking for gold, which I guess doesn't work very well with what you are trying to do. Link to comment Share on other sites More sharing options...
Recommended Posts