[Help] Using 'require' with client scripts


#1

Using require "resources/mymod/myluafile" in my server scripts works fine. But trying to do the same in a client script doesn’t seem to want to cooperate. I’ve tried adding “myluafile” to files {} in the __resources.lua but it still doesnt work. Gives an error on the client saying its calling with a nil value.

Any help is greatly appreciated


#2

Clientside scripting can’t use require :frowning: ( from my knowledge ). If you really wan’t it to be in diffrent files you should use events to execute after everything has loaded.


#3

Thanks, i ended up using exports to accomplish what i was looking for :slight_smile:


#4

Awesome :slight_smile: Also moving this to scripting help.