Unexpected symbol near '.'
up vote
0
down vote
favorite
I tried changing to ansi, but it didn't work.
it is in line 5: unexpected symbol near '.'
side = { 0, Arena.width }
function Update()
local chasingbullet = CreateProjectile('bullet', myTable[ math.random( #myTable )], math.random(0, Arena.height))
local chasingbullet.SetVar('speed', 0)
local dist = Player.x - chasingbullet.x
local speed = chasingbullet.GetVar('xspeed') / 2 + xdifference / 100
chasingbullet.Move(speed, 0)
chasingbullet.SetVar('speed', speed)
end
every place i search, don't help me and say that the code is normal
function variables lua
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
favorite
I tried changing to ansi, but it didn't work.
it is in line 5: unexpected symbol near '.'
side = { 0, Arena.width }
function Update()
local chasingbullet = CreateProjectile('bullet', myTable[ math.random( #myTable )], math.random(0, Arena.height))
local chasingbullet.SetVar('speed', 0)
local dist = Player.x - chasingbullet.x
local speed = chasingbullet.GetVar('xspeed') / 2 + xdifference / 100
chasingbullet.Move(speed, 0)
chasingbullet.SetVar('speed', speed)
end
every place i search, don't help me and say that the code is normal
function variables lua
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3
It's a Syntax / Parsing Error: so, which line and which part of the line? After identifying what the error message is referring to, why does the error make sense? Hint: something aboutlocaland what variables are what variables are not.
– user2864740
Nov 20 at 23:47
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I tried changing to ansi, but it didn't work.
it is in line 5: unexpected symbol near '.'
side = { 0, Arena.width }
function Update()
local chasingbullet = CreateProjectile('bullet', myTable[ math.random( #myTable )], math.random(0, Arena.height))
local chasingbullet.SetVar('speed', 0)
local dist = Player.x - chasingbullet.x
local speed = chasingbullet.GetVar('xspeed') / 2 + xdifference / 100
chasingbullet.Move(speed, 0)
chasingbullet.SetVar('speed', speed)
end
every place i search, don't help me and say that the code is normal
function variables lua
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I tried changing to ansi, but it didn't work.
it is in line 5: unexpected symbol near '.'
side = { 0, Arena.width }
function Update()
local chasingbullet = CreateProjectile('bullet', myTable[ math.random( #myTable )], math.random(0, Arena.height))
local chasingbullet.SetVar('speed', 0)
local dist = Player.x - chasingbullet.x
local speed = chasingbullet.GetVar('xspeed') / 2 + xdifference / 100
chasingbullet.Move(speed, 0)
chasingbullet.SetVar('speed', speed)
end
every place i search, don't help me and say that the code is normal
function variables lua
function variables lua
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 2 days ago
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Nov 20 at 23:38
Murilouco
32
32
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Murilouco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3
It's a Syntax / Parsing Error: so, which line and which part of the line? After identifying what the error message is referring to, why does the error make sense? Hint: something aboutlocaland what variables are what variables are not.
– user2864740
Nov 20 at 23:47
add a comment |
3
It's a Syntax / Parsing Error: so, which line and which part of the line? After identifying what the error message is referring to, why does the error make sense? Hint: something aboutlocaland what variables are what variables are not.
– user2864740
Nov 20 at 23:47
3
3
It's a Syntax / Parsing Error: so, which line and which part of the line? After identifying what the error message is referring to, why does the error make sense? Hint: something about
local and what variables are what variables are not.– user2864740
Nov 20 at 23:47
It's a Syntax / Parsing Error: so, which line and which part of the line? After identifying what the error message is referring to, why does the error make sense? Hint: something about
local and what variables are what variables are not.– user2864740
Nov 20 at 23:47
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
local chasingbullet.SetVar('speed', 0) has a syntax error. local can only be followed by a variable name or list of names and an optional equals sign and list of expressions; for example:
local a
local a = 1
local a, b
local a, b = 1, 2
local a, b = 1
So the parser is okay with local chasingbullet, but then it sees the dot (.) and complains because a dot is not allowed there. To fix the error, just remove local: chasingbullet.SetVar('speed', 0).
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
local chasingbullet.SetVar('speed', 0) has a syntax error. local can only be followed by a variable name or list of names and an optional equals sign and list of expressions; for example:
local a
local a = 1
local a, b
local a, b = 1, 2
local a, b = 1
So the parser is okay with local chasingbullet, but then it sees the dot (.) and complains because a dot is not allowed there. To fix the error, just remove local: chasingbullet.SetVar('speed', 0).
add a comment |
up vote
1
down vote
accepted
local chasingbullet.SetVar('speed', 0) has a syntax error. local can only be followed by a variable name or list of names and an optional equals sign and list of expressions; for example:
local a
local a = 1
local a, b
local a, b = 1, 2
local a, b = 1
So the parser is okay with local chasingbullet, but then it sees the dot (.) and complains because a dot is not allowed there. To fix the error, just remove local: chasingbullet.SetVar('speed', 0).
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
local chasingbullet.SetVar('speed', 0) has a syntax error. local can only be followed by a variable name or list of names and an optional equals sign and list of expressions; for example:
local a
local a = 1
local a, b
local a, b = 1, 2
local a, b = 1
So the parser is okay with local chasingbullet, but then it sees the dot (.) and complains because a dot is not allowed there. To fix the error, just remove local: chasingbullet.SetVar('speed', 0).
local chasingbullet.SetVar('speed', 0) has a syntax error. local can only be followed by a variable name or list of names and an optional equals sign and list of expressions; for example:
local a
local a = 1
local a, b
local a, b = 1, 2
local a, b = 1
So the parser is okay with local chasingbullet, but then it sees the dot (.) and complains because a dot is not allowed there. To fix the error, just remove local: chasingbullet.SetVar('speed', 0).
answered 2 days ago
cyclaminist
64919
64919
add a comment |
add a comment |
Murilouco is a new contributor. Be nice, and check out our Code of Conduct.
Murilouco is a new contributor. Be nice, and check out our Code of Conduct.
Murilouco is a new contributor. Be nice, and check out our Code of Conduct.
Murilouco is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53403237%2funexpected-symbol-near%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
It's a Syntax / Parsing Error: so, which line and which part of the line? After identifying what the error message is referring to, why does the error make sense? Hint: something about
localand what variables are what variables are not.– user2864740
Nov 20 at 23:47