Jump to content

New to scripting; EOF issue


Boom271

Recommended Posts

I'm just testing out different scripts for practice and I keep getting an EOF issue with the first line.

 

I'm getting the compiler error at (13,0): Missing EOF at 'if'

 

 

if x > (99)
(Game.GetPlayer().AddItem(BearClaw))
(Game.GetPlayer().RemoveItem(Gold, 100))
elseif x < (100)
(Debug.MessageBox("You don't have enough gold."))
endif 

 

I used this to set X.

 

x = (Game.GetPlayer() .GetGoldAmount)

Edited by Boom271
Link to comment
Share on other sites

this appears to be the problem.

 

x = (Game.GetPlayer() .GetGoldAmount)

you have a space here^ and no cast ^

 

it needs to be

x = (Game.GetPlayer().GetGoldAmount())

 

and if that doesn't work add an extra = sign for the hell of it and try it. x == (etc.

Edited by DeadlyCobraXXX
Link to comment
Share on other sites

this appears to be the problem.

 

x = (Game.GetPlayer() .GetGoldAmount)

you have a space here^ and no cast ^

 

it needs to be

x = (Game.GetPlayer().GetGoldAmount())

 

and if that doesn't work add an extra = sign for the hell of it and try it. x == (etc.

 

I may be wrong, but I am almost positive you only use == within comparisons like if (something == somethingelse)

 

while a single = is used to assign a value to a variable

 

 

So I would wager your first suggestion is correct

Link to comment
Share on other sites

I tried replacing x = (Game.GetPlayer() .GetGoldAmount) with x = (Game.GetPlayer().GetGoldAmount()) and didn't have much luck so i'm just going to rewrite everything. But thank you everyone that tried to help =)
Link to comment
Share on other sites

no need, PM me the exact script that you have. I'll have it fixed for you in a minute, or tell you the problem of why it isnt working.

 

 

Thank you i re-wrote and it works fine... I had a misunderstanding with the properties also, so that probably didn't help. =p But i got it working

Link to comment
Share on other sites

  • Recently Browsing   0 members

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