Refresh file.lua in cache ressource without restart resource

hello, is it possible to have this kind of modification without having to restart the script so just restart a lua file?

thank you in advance.

Before the modification

After the modification

function ReloadScript()
    local resource = GetCurrentResourceName()
    local filePath = "client/modules/escape.lua"
    local fileContent = LoadResourceFile(resource, filePath)

    if fileContent then
        print("File reload")
        print("No file reload")

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!

1 Like

The client won’t receive the updated files until you restart the resource. You are better off just using replicated convars for configuration, or some own logic using events.

1 Like