I am having a weird but simple error in my code and I was wondering if anyone would be able to help me fix this. I'll upload my error message and the code with this post. Thanks for any help!
Error Message:
Error
Syntax error: main.lua:164: 'then' expected near '='
Traceback
[C]: at 0x7ffa33b728f0
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
Odd Simple Error
Re: Odd Simple Error
Here is the offending code,
it's because you accidentally used assignment = instead of comparison == in an if statement.
Code: Select all
if firetype = "Minigun" then
baseRate = 0.75
elseif firetype = "Laser" then
baseRate = 0.6
end
Code: Select all
if firetype == "Minigun" then
baseRate = 0.75
elseif firetype == "Laser" then
baseRate = 0.6
end
Re: Odd Simple Error
I still do that mistake.
Every.
Single.
Time.
Can't kill some habits.
Every.
Single.
Time.
Can't kill some habits.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests