0

i have this code :

include("autorun/sh_myaddon.lua")
local myName = "Jakub"
local age = 999
print(myName)
print(age)

When i pressed f7 this showned up :

lua: ...rrysmod\addons\myaddon\lua\autorun\server\sv_myaddon.lua:1: attempt to call a nil value (global 'include')
stack traceback:
    ...rrysmod\addons\myaddon\lua\autorun\server\sv_myaddon.lua:1: in main chunk
    [C]: in ?

I Tried searching but i found nothing :(

  • 3
    That error message looks like it's being given by stand-alone Lua. "include" seems to be a Lua extension from Garry's Mod, so it will fail like this if you aren't running it through Garry's Mod. Presumably "F7" is some auto-run feature of your IDE, and it isn't set up to run your code via Garry's Mod (if that is even possible). – tehtmi Jul 31 '23 at 21:04

0 Answers0