#Locals out of the way
1 messages · Page 1 of 1 (latest)
Here is code if you want to test it out (should not be used at roleplay server)
Common issues:
- chatgpt "fixed" some issues and replaced some of code so dont expect it to work 100% of time lol
function normalize(vec)
local length = math.sqrt(vec.x * vec.x + vec.y * vec.y + vec.z * vec.z)
if length ~= 0 then
return vector3(vec.x / length, vec.y / length, vec.z / length)
else
return vector3(0.0, 0.0, 0.0)
end
end
AddEventHandler('entityDamaged', function(victim, culprit, weapon, damage)
if IsPedInAnyVehicle(PlayerPedId()) and GetEntityType(victim) == 2 then
local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local victimVehicle = victim
local playerCoords = GetEntityCoords(playerVehicle)
local victimCoords = GetEntityCoords(victimVehicle)
local forceDirection = (victimCoords - playerCoords) * vector3(1.0, 1.0, 0.0)
local normalizedForce = normalize(forceDirection)
local forceMultiplier = 10.0 -- Adjust this value to change force of velocity
local victimVelocity = GetEntityVelocity(victimVehicle)
local newVelocity = victimVelocity + normalizedForce * forceMultiplier
SetEntityVelocity(victimVehicle, newVelocity.x, newVelocity.y, newVelocity.z)
end
end)
where to put?
any client file
haha nice it’s hilarious to watch
good idea, however i think something I would do is make them vanish, could only imagine the police chases with this 
all you have to do is turn up the fmass on the vehicles handling metas you want.
That works too but at NoPixel fmass values have not been touched which means they have scripted this thing or else its just really bad desync
making them vanish would be a lot better IMO
very interesting take , do you feel they use a seperate inertia or vecmass script that could apply that force to the vehicles hence giving the illusion of that weight system?
It has to be scripted as modifying mass of vehicles doesn't seem to do same that they have done. I think they may have made npc vehicles have less mass using natives or else they just apply force on them based of speed and rotation of player's vehicle