Jump to content

Variables and arithmetic (simple question)


Antoni

Recommended Posts

Posted

So I'm learning Lua and when I do this:

n = 20 
s = 390 
= n + s 

I get the error:

input:3: unexpected symbol near '=' 

I think my tutorial is giving me an example like this from 5.1 so how would I write this in 5.2?

BUY/SELL/TRADE ANYTHING RELATED TO MTA

SERVER ACCOUNTS

SERVER MONEY

GAMEMODES

SCRIPTING SERVICES

temp_Sig.png

Posted
20 = n 
390 = s 
= n + s 

input:1: unexpected symbol near '20' 

I don't think it's that. I'm running off http://www.lua.org/cgi-bin/demo could that be the problem? Do I need some kind of plugins first?

BUY/SELL/TRADE ANYTHING RELATED TO MTA

SERVER ACCOUNTS

SERVER MONEY

GAMEMODES

SCRIPTING SERVICES

temp_Sig.png

  • Moderators
Posted

Print is visible in the server console, but yes better to use output's.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

It was simply because I was using the live demo. Thanks, it's working on the downloaded version.

BUY/SELL/TRADE ANYTHING RELATED TO MTA

SERVER ACCOUNTS

SERVER MONEY

GAMEMODES

SCRIPTING SERVICES

temp_Sig.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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