Client Sided script does not start properly (Possible KeyMapping issue)

Hello,
I have an issue, I created an only client sided script, and added it to my server.cfg. But when a player connects, everything seems correct, unless that he cannot use the script, it looks like the issue comes from the RegisterKeyMapping native.

Once I restart the script (via txadmin console) it works for the player. (but if he disconnect/reconnect, it won’t work until I restart the script again).

I checked the server console, there are no errors on startup.

Would someone be able to find the solution ? :grinning:

Environment questions

Latest version of GTAV, up to date, Legit, Steam

What have you tried already to fix the issue?
Clear server and client cache, change the position in the server.cfg, put the RegisterKeyMapping on top of the file, restart the server.

What server did you get this issue on? Be specific and name some, ‘all of them’ by itself isn’t useful!
My own localhost server.

Here you can read the beggining of my script :

--Auteur: Cabe Gallo---
print("Demarrage Stopstick")

local stopstick='w_me_gclub'
local stopstickHash=GetHashKey(stopstick)
local weapon_stopstick="weapon_golfclub"

RegisterKeyMapping('+stopstick', 'Manipulations stopstick', 'keyboard', 'k')
RequestModel(stopstickHash)
RegisterCommand('+stopstick',function()
    --La touche k à été enclanchée
    TriggerEvent('manip_stopstick')

end)
RegisterCommand('-stopstick',function()
end)--Simple commande pour permettre de masquer affichage chat


local playerPed=PlayerPedId()
--Thread crevaison de pneu(s)
Citizen.CreateThread(function()

    while true do
         
        if IsPedInAnyVehicle(playerPed,false) then 

            local playerPos=GetEntityCoords(playerPed)
...

Here is my fxmanifest.lua :

fx_version 'cerulean'
game 'gta5'

author 'Cabe Gallo'
description 'Crève les pneus du véhicule dans lequel est le joueur'
version '1.0.0'

client_script 'stopstick_client.lua'

Thanks a lot :grinning:
Cabe Gallo

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 Cfx.re 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!
:mascot:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.