How to kick someone from a FiveM server when they press F1

Could someone help me out here with making a script which when F1 is pressed it kicks that player from the server with the message ‘Remove Lambda Menu!’

Many thanks,
James

You know there is a disable scripthook option in your server.cfg right?

2 Likes

More specifically sv_scriptHookAllowed

Yes, I’m well aware of the scriptHookAllowed however I wanted to allow other scripthooks to operate hence why I wanted specifically the F1 key to kick the user with the message

You know they can change the controls to open it and such right?

3 Likes

Yes I am aware
Would you say there is any way around this? Without me wanting to remove scriptHook?

have u found a fix?

Smallo already mentioned a fix.

Just put :
IfIsControlJustPressed (idk if it’s correct , check the native on Google) then
(Here you put your kick function)