fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Code execution on resource initialization?

Open gtasnail opened this issue 10 months ago • 2 comments

What happened?

I'm not entirely sure if this is intended to happen but you can provide code that executes on server start-up via fxmanifest using pcall (without said resource added to start-up) it also executes when refreshing resources

Expected result

I'm honestly not sure

Reproduction steps

Simple basic resource setup with a fxmanifest

Example code with the "issue" present

function stonky()
    print('Hello on refresh resource?')
end
pcall(stonky)

fx_version 'cerulean'
game 'gta5'

Example image of output: image

Importancy

Unknown

Area(s)

FiveM, RedM, FXServer, ScRT: Lua

Specific version(s)

Server 7290 windows

Additional information

No response

gtasnail avatar Apr 18 '24 02:04 gtasnail

It's a Lua file, that's expected.

slashkeyvalue avatar Apr 18 '24 03:04 slashkeyvalue

The fxmanifest.lua is the start entry of the script, in which you define information about the script, it is normal that code can be executed

DaniGP17 avatar Apr 18 '24 08:04 DaniGP17