'=' expected near 'player'

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Valcos
Prole
Posts: 1
Joined: Sun Dec 07, 2014 11:13 am

'=' expected near 'player'

Post by Valcos »

I'm pretty new to Love2d and have done a lot of guessing, but can somebody tell me what's wrong with this?

I'm getting the error: '=' expected near 'player'

From this code:
If player.x > 200 and
player.x < 1080 then
player.x = getMouse.x(dt)
end
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: '=' expected near 'player'

Post by bartbes »

If you use the

Code: Select all

 tags on the forums, the formatting will be preserved. The problem seems to be, however, that you wrote 'if' as 'If'.
User avatar
Doctory
Party member
Posts: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: '=' expected near 'player'

Post by Doctory »

nope, its an i
did you define the function getMouse.x?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: '=' expected near 'player'

Post by bartbes »

I did write an I, just a capital one.
User avatar
Jasoco
Inner party member
Posts: 3728
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: '=' expected near 'player'

Post by Jasoco »

The point is, if the code in the OP is exact, bartbes is right. You capitalized the word "if". (Lua is case sensitive)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests