[Release] [Standalone] Proper Drift script!

yeah. i play around with the code to change it. when i turn off the drift, handling messup xD

When i’m loading it on server it freezes when loading vehicles.meta

cap2

Never happened to me or my community. Another resource causes the issue.

any idea how i can stop cars slowing down taking corners at high speed and linking drifts, its kind of difficult. drifting at slower speeds is great but notice the car doesnt respond much at higher speeds and seems like it enables some type of speed limit restriction.

The whole idea in this script is to make the car overpowered and then reduce it’s speed by adding a loads of drag - car spins, but doesn’t goes to space.

Ideal situation would be, if there would be manual transmission developed specifically for FiveM, so you could drift as IRL. And IKT’s MT for GTA doesn’t sync well in FiveM and gives you very annoying sound glitch (constant revving of opponent’s car).

You can try to adjust the drag coefficient yourself, just lower it down by some number. Just make sure you will do the same in it’s counterpart line (the whole script is based on adding and decreasing the same value on top of the original one).

1 Like

The script is awesome, and combined with DriftCounter is pretty good thing, but hell, is hard to do drifts… :joy: :smiling_face_with_three_hearts:

so what do u mean by changing car default value in handling file ?! i have some cars thats works pretty well with tcs off but when i get tcs on they get stuck yeah and i indeed see some number that have letters (for what i see for ur example the problems its the ones that have letters right?) now my question is how do u know what value will i change on handling file if u get some of those numbers with letters !? besides that great script tks for ur work

You said it right.

Below are values printed in the exact order. Change those values with letters in them in mentioned cars having the glitch after turning TCS on again. Just go to that car’s handling and change the value just a tiny bit and try TCS again. Obviously, if you will change values because of the glitch within TCS script, you may get new bunch of false results with different cars. It’s better to tweek handlings a bit instead.

“fInitialDragCoeff”
‘fDriveInertia’
“fSteeringLock”
“fTractionCurveMax”
“fTractionCurveMin”
“fTractionCurveLateral”
“fLowSpeedTractionLossMult”

1 Like

ty will try it later then another question is it possible to make it drif while shift(control) is press and turn tcs on when shift is released ?! i tried this but didnt work.

if GetHandlingfInitialDragCoeff >= 50.0 then

                        DriftOff()

                    else if IsControlPressed(0, 21) and ((GetVehicleClass(vehicle) == 0) or (GetVehicleClass(vehicle) == 1) or (GetVehicleClass(vehicle) == 2) or (GetVehicleClass(vehicle) == 3) or (GetVehicleClass(vehicle) == 4) or (GetVehicleClass(vehicle) == 5) or (GetVehicleClass(vehicle) == 6) or (GetVehicleClass(vehicle) == 7) or (GetVehicleClass(vehicle) == 9)) then

                        DriftOn()

                    end

tried changing the line before that too , to if iscontrolreleased but nothing…besides that tks for the script great work <3

I came across this script when looking for a way to create a drift mode. It works pretty good but the code is a bit messy :sweat_smile:
I’ve cleaned it up and also optimized it a bit. You can take a look at it on my fork on Github.
If you want I can open a PR on your repo to merge these changes :slight_smile:

2 Likes

We will be reopening the server soon and I wanted to rewrite the script as well and to add few new features. If you already did some improvements, feel free push it on GitHub then!

I opened a PR.

In the readme you mentioned that some cars have problems with the mode, any examples? Because I couldn’t reproduce the bug…

I love what you did with it! Cleanup very well deserved. Pull request has been merged with your credit. Thank you.

That bug is kinda rare, but when it does happen, simply change the base value in handling file of the car for few hundredth, or any number really and it will smooth it out. I can’t explain it better than I did in my readme. :slight_smile:

1 Like

What am I doing wrong? Like prescribed even the file _resource.lua client_script ‘cl. lua’ but on my local server does not allow, you would at least make the resource)

You changed something you shouldn’t. client.lua isn’t probably loaded correctly via __resource.lua.

Also, you should update __resource.lua to fxmanifest.lua

the car likes to go really fast with this script and wont stop at all
when you turn it on or off

1 Like

That’s because another script conflicts with it and bugs out correct value change when reverting back.

Try to start up the server with ONLY drift script and nothing else that might have anything to do with changing vehicle properties (to change it’s handling)

1 Like

is there a way to make this script work with addon cars?

It works fine with any car, unless some vehicle classes are blacklisted (motorbikes or emergency for example).