Skip to content

Code execution on resource initialization? #2473

Open
@gtasnail

Description

@gtasnail

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

Metadata

Metadata

Assignees

Labels

RedMIssues/PRs related to RedMScRT: LuaIssues/PRs related to the Lua scripting runtimebugtriageNeeds a preliminary assessment to determine the urgency and required action

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions