New Project, Everything is "Undefined"

So I opened up FxDK, started a new project and started creating a simple chat command resource. Problem is everything that I type in is “global undefined” and therefore will not execute. I’ve included screenshots of my extensions and of the files currently in the project. I haven’t been able to find out what dependencies I may be missing. When launching the game in game viewer it works, its just that the resources do not execute because everything is “undefined”.
Screenshot (833)
Screenshot (834)

hello were u replying to me

No I’m asking a question in the forum.

I don’t think that’s the case - did you enable your resource?

No, everything is “undefined”

It also happens in VSCODE

These shouldn’t stop compilation, these are just warnings you could add the globals yourself if you wanted to

  1. Go to the gear on the bottom left of your screen, click it and then click settings.
  2. Put in @ext:sumneko.lua
  3. Scroll to Lua > Diagnostics: Globals
  4. Add the globals you need (in this case client_script, server_script, shared_script, game, fx_version, but there would be more)

And as for things in the scheduler

  1. Go to %localappdata%/FiveM/FiveM.app/citizen/scripting/lua
  2. Copy the actual file location (should be something like C:/Users/Avarian)
  3. Go to your settings and type in @ext:sumneko.lua
  4. Scroll to the very bottom where you should find “Lua > Workplace: Library”
  5. Add your path and then add \scheduler.lua to the end of it, this will only load the scheduler.lua, instead of all the files, you can include everything but that also means it will load

You might also want to add “Nonstandard Symbols”:

This will allow for you to use these symbols in any Lua 5.4 script (and backticks in any script)

If natives still aren’t showing you can use an extension to fix it:

2 Likes

Worked for me, thanks!