Auto Kick Script For FailRP in Cars

Hello community of FiveM!
I’ve been looking on this kind of script for ages…
I’ve made a FiveM RP server, but every time someone gets in a police chase,
they just use the fastest car ever and dissapear in a blink of an eye!
Is there a script that kicks people whenever they go past a certain speed limit?
I want one which kicks you if you go 120 or more mph.
HELP!
Any responce is appriciated!
(sari fer bed englash)

Wouldn’t that go a little too far, maybe it would be better to just either make cars slower or police cars faster?

But if you really would go that far make some kind of check like

CreateThread(function()
    while true do
        Wait(1000)
		
		if IsPedInAnyVehicle(PlayerPedId()) and GetEntitySpeed(GetVehiclePedIsIn(PlayerPedId())) > 120 then
			TriggerServerEvent("whoaimfast")
		end
	end
end)

and in serverside script

RegisterNetEvent("whoaimfast")
AddEventHandler("whoaimfast", function()
	DropPlayer(source, "You are going way too fast in a car lul")
end)

Thanks! Love ya : )

Sorry, suck at coding, what am I supposed to name the two .lua files?

client.lua and server.lua? doesn’t really matter as long as you add them right to your __resource.lua

is PlayerPedID depracated? it can’t find the global val

Anti Speed.zip (966 Bytes)

Kind of a necro but It should be

		if IsPedInAnyVehicle(PlayerPedId()) and GetEntitySpeed(GetVehiclePedIsIn(PlayerPedId()))*2.236936 > 120 then

The native “GetEntitySpeed” returns in meters not miles