Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- .: WHAT I AM TRYING TO ACCOMPLISH :. --
- Im trying to load a script into a variable which can display internal information
- -- .: ERROR :. --
- "/home/run.lua:2: attempt to index local 'test' (a function value)"
- -- .: FIX :. --
- Change from 'loadfile' to 'dofile'
- *Solved by IRC user 'payonel'*
- ^^ Thanks alot!! ^^
- -- .: FILES & CODE :. --
- |-------------------------------------------------------|
- | -- "/home/run.lua" -- |
- |-------------------------------------------------------|
- | **local test = loadfile("/home/test.lua", "bt", _G)** |
- | local test = dofile("/home/test.lua", "bt", _G) |
- | print(test.variable) |
- | |
- |-------------------------------------------------------|
- |----------------------------------------------------|
- | -- "/home/test.lua" -- |
- |----------------------------------------------------|
- | local test = {variable = "This is a test string"} |
- | return test |
- | |
- |----------------------------------------------------|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement