Jump to content

2 (or more) parts to a function


callum123

Recommended Posts

Posted
try this:
hello = { 
hi = true 
hey = true 
} 

It's exactly the same.

@callum123, it works, I even tested the code to be sure.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

Tryed that, but still get the error. Let me show you it exactly. Since I am using pictures.

Error: lua:2: '}' expected (to close '{' at line 1) near '='

local hello = { 
    'hi.png' = true, 
    'hey.png' = true, 
} 

Posted
Tryed that, but still get the error. Let me show you it exactly. Since I am using pictures.

Error: lua:2: '}' expected (to close '{' at line 1) near '='

local hello = { 
    'hi.png' = true, 
    'hey.png' = true, 
} 

Strings must use [ ], e.g.:

local hello =  
{ 
    ['hi.png'] = true, -- this needs [] as it is a string 
    bye = true -- this doesn't need [] as it is a variable 
} 

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

You're welcome :P

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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...