I’m trying to figure out how to make this script work
if Config.VehicleFreezeEnabled then
RegisterCommand('+vfreeze', function() VFreeze() end, false)
RegisterCommand('-vfreeze', function() StopVFreeze() end, false)
RegisterKeyMapping("+vfreeze", "Toggleable Freeezing Vehicle", "keyboard", Config.VehicleFreezeKeybind)
local stop = true
function VFreeze()
local player = GetPlayerPed(-1)
local vehicle = GetVehiclePedIsIn(player, false)
if Config.VehicleFreezeToggle then
stop = not stop
else
stop = false
end
while not stop do
FreezeEntityPosition(vehicle, false)
Wait(0)
end
end
function StopVFreeze()
if Config.VehicleFreezeToggle then return end
stop = true
end
end
It works, but only if I set it to false or true
FreezeEntityPosition(vehicle, false)