Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code execution on resource initialization? #2473

Open
gtasnail opened this issue Apr 18, 2024 · 2 comments
Open

Code execution on resource initialization? #2473

gtasnail opened this issue Apr 18, 2024 · 2 comments
Labels
bug RedM Issues/PRs related to RedM ScRT: Lua Issues/PRs related to the Lua scripting runtime triage Needs a preliminary assessment to determine the urgency and required action

Comments

@gtasnail
Copy link

gtasnail commented Apr 18, 2024

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 gtasnail added bug triage Needs a preliminary assessment to determine the urgency and required action labels Apr 18, 2024
@github-actions github-actions bot added RedM Issues/PRs related to RedM ScRT: Lua Issues/PRs related to the Lua scripting runtime labels Apr 18, 2024
@slashkeyvalue
Copy link
Contributor

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

@gtasnail gtasnail changed the title Code execution without resource start? Code execution on resource initialization? Apr 18, 2024
@DaniGP17
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug RedM Issues/PRs related to RedM ScRT: Lua Issues/PRs related to the Lua scripting runtime triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

3 participants