> For the complete documentation index, see [llms.txt](https://hexose.gitbook.io/dx-modding-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hexose.gitbook.io/dx-modding-guide/lua-api/working-with-gml.md).

# Working with GML

FNFFD is made with gamemaker! this means that (mostly) everything from gml is accessible from lua.\
\
this is **VERY** important for making mods!! its very useful to get used to gml first before using modding with dx\
its a good idea to have experience with fnffd's source code or atleast have a reference to it while you make scripts!\
\
if you’re more used to GML, or need to use it instead of lua for a specific scenario, like psych engine’s runHaxeCode you can use loadGML to run gml code in your lua scripts!\
\
this can come with a slight performance cost though, so use with caution!

### loadGML(code: String)

runs GML code through a string! (self explanatory)\
\
EXAMPLE:

```lua
function onCreatePost()
     loadGML([[
          show_message(“hello from gml”)
     ]])
     show_message(“hello from lua”)
end

```

you can also access an object's variables directly from lua

```lua
function onCreatePost()
    obj_player.image_xscale = 2 -- make dude wide
end
```
