Adjusting skills as recently mentioned on official FiveM Twitter?

I tried the search but all the threads I found were made prior to this update. I’m assuming with the new update the problem those threads were complaining about doesn’t exist anymore?

I have almost no experience with LUA other than making some tweaks/customizations to others’ code. Could someone tell me how I’d go about setting all players skills at server start/player login? Basically want to have everyone’s skills maxed at all times, even after they’ve changed their ped model using Mello Trainer.

For example:

StatSetInt('MP0_SHOOTING_ABILITY', 100, true)

The character used is MP0, you can see all stats in common.rpf/data/spstatssetup.xml and mpstatssetup.xml.

— FiveM (@_FiveM) November 11, 2017

I don’t quite understand. Is MP0 a PlayerID of 1? And can I just throw that in a .lua file without any further syntax around it?

So I managed to put this together, thanks to @Vespura’s post in another thread of mine.

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        StatSetInt('MP0_STAMINA', 100, true)
        StatSetInt('MP0_STRENGTH', 100, true)
        StatSetInt('MP0_LUNG_CAPACITY', 100, true)
        StatSetInt('MP0_WHEELIE_ABILITY', 100, true)
        StatSetInt('MP0_FLYING_ABILITY', 100, true)
        StatSetInt('MP0_SHOOTING_ABILITY', 100, true)
        StatSetInt('MP0_STEALTH_ABILITY', 100, true)
    end
end)

What still confuses me though is how do I set max health and is “WHEELIE_ABILITY” driving skill?

1 Like

I think, you don’t need to put it in infinite loop. I tried with just calls on time and it have worked

Wheelie ability would be to do with motorbikes,

and to set max health : SetEntityMaxHealth(entity, value)

@Jump_On_Studios how would I do that? I have no knowledge of LUA other than making small edits to other peoples’ open source resources.

@nopixel Thank you.

Edit:
@nopixel Odd, I didn’t see any “driving_ability” in the file… Also, what would I enter for the “entity” field in max health?

Just figured out the entity on my own from another piece of code someone showed me. Would the below be correct for full health?

SetEntityMaxHealth(PlayerId(), 100)

Someone DM’d me asking what I’m currently using so I’m just going to post it here in case it helps anyone else.

client.lua:

local a = {
	'MP0_STAMINA',
	'MP0_STRENGTH',
	'MP0_LUNG_CAPACITY',
	'MP0_WHEELIE_ABILITY',
	'MP0_FLYING_ABILITY',
	'MP0_SHOOTING_ABILITY',
	'MP0_STEALTH_ABILITY'
}
for _, s in ipairs(a) do
	StatSetInt(s, 100, true)
end

Note that the above does not grant max health. It maxes out all players stamina, strength, lung capacity, flying skill, shooting skill, stealth skill and I believe their skill at doing wheelies.