#backfire
1 messages · Page 1 of 1 (latest)
Or a drift trace
you could just put a particle emitter at the tail pipe. im not sure when it would backfire but, when it does just set the ParticleEmitter's "Enabled" setting to false and do
ParticleEmitter:Emit(x)
-- you can remove x for a default of 16, or replace x with the number of particles you want
Sorry for my English lol
Yes ik this but how manage this ?
what do you mean manage?
Make it working but not all time
im not a car guy, when does a car backfire? just randomly?
I think when acceleration
do you know how to run a function when your car accelerates?
do you have a acceleration number somewhere?
Acceleration number ?
wait so it happens when the car is gaining speed right?
or when its going fast?
so you have to check if the speed of the car is above a certain number when its moving
Ok
Thanks
Ik how to do this
if speed > 110 end
— do the thing
end
If I’m not wrong
yes but you have to put that in a loop or something that is called every frame with runservice
Ok but how do this a little bit randomly ?
you could do this to change the amount of particles randomly
ParticleEmitter:Emit(math.random(4, 32) --you choose the min and max
Kk thank you so much
and you could do this so it randomly waits between backfires
task.wait(math.random(.1, .5)) --you choose the min and max
And how know when the car have a acceleration or deceleration ?
Thanks you so much :)
have you taken phyisics or anything with acceleration in school?
No
Im French and I’m 16 I don’t have learned this
How ?
errm
maybe you could make a varible of the car's speed, then a second later you make another varible of the car's speed, and then you minus the second speed with the first speed to get the acceleration
Ok i will try thanks
then you check if the acceleration amount is high enough for the car to backfire
k
gotchu
So, here's the code that creates particle emitter with "working backfire"
local Gun = script.Parent
local Config = Gun:FindFirstChild("Config")
local Remote = Gun:FindFirstChild("Remote")
local Plir = game:GetService("Players"):GetPlayerFromCharacter(Gun.Parent)
local IsReload = false
Remote.Fire.OnServerInvoke = function(SendPlir, Hit)
if SendPlir == Plir then
return
end
local Projectile = Instance.new("Part", workspace.Camera.Projectile)
Projectile.Size = Vector3.new(1, 1, 1)
Projectile.Position = Gun.ShootPart.Position
Projectile.Anchored = true
Projectile.CanCollide = false
Projectile.Material = Enum.Material.Neon
-- Create a particle emitter
local ParticleEmitter = Instance.new("ParticleEmitter", Projectile)
ParticleEmitter.Color = ColorSequence.new(Color3.fromRGB(255, 0, 0))
ParticleEmitter.Lifetime = NumberSequence.new(0.5)
ParticleEmitter.Size = NumberSequence.new(0.5)
ParticleEmitter.Rate = 50
ParticleEmitter.EmitterSize = Vector3.new(0.1, 0.1, 0.1)
ParticleEmitter.LightEmission = 1
Projectile.Velocity = (Hit - Gun.ShootPart.Position).Unit * Config.Velocity.Value
end
```lua
This code will create a red particle emitter attached to the projectile, giving it a visual effect during its drive
Ty