A-Chassis Part Booster

Hello, im having problems figuring out how to make a booster where the player inside the car touches the booster part and will make the car chassis go at a certain speed for 5 seconds for example.

I tried using the velocity value but kept getting errors when I tried using vector3. I checked the web but I didnt find any answers, and all devfourms which asked this question were left unanswered.

the only thing i would like to achieve is when the car the player is in touches a part it will boost it to a certain speed for 5 seconds for example and then revert the speed back to normal.

So, what code do you have now?

I have tested a new method but it says it’s working but it doesnt actually make it go faster

This is a script in starterplayerscripts:

local Event = game:GetService("ReplicatedStorage").Events.AttackMode

workspace.Stage2.Touched:Connect(function()
		Event:FireServer()
		print("EventFired")
end)

and the event thing is inside the driveseat of the car:

local isBoosting = false;
local body = script.BodyValue.Value

wait(.5)

coolDownTime = 2;
boostTorque = -10;

function Boost()
		if isBoosting == false and script.Parent.Occupant then
			isBoosting = true;
		
		local currentTorque = script.Parent.Torque
				script.Parent.Torque = boostTorque
				script.Parent.Throttle = 1;
				print("Boosted")
				wait(coolDownTime)
				isBoosting = false
				script.Parent.Torque = currentTorque
				print("RevertedTorque")
		end
end

game.ReplicatedStorage.Events:WaitForChild("AttackMode").OnServerEvent:Connect(Boost)

A-Chassis does not use the seat’s throttle and torque. You need to apply velocity using :ApplyImpulse.

How would I use ApplyImpulse as I have never used it before?

You simply would give it a vector3, in your case script.Parent.CFrame.LookVector * script.Parent.AssemblyMass.

Sorry if I don’t know much about this, but would I put it into the script like this?

local isBoosting = false;
local body = script.BodyValue.Value

wait(.5)


function Boost()
		if isBoosting == false and script.Parent.Occupant then
			isBoosting = true;
		
				script.Parent.CFrame.LookVector * script.Parent.AssemblyMass
				print("Boosted")
				wait(coolDownTime)
				isBoosting = false
				print("RevertedTorque")
		end
end

game.ReplicatedStorage.Events:WaitForChild("AttackMode").OnServerEvent:Connect(Boost)

You would do

script.Parent:ApplyImpulse(script.Parent.CFrame.LookVector * script.Parent.AssemblyMass)

right where you put it in your script.

im not sure if am missing anything but it still doesnt boost it?

You might need to multiply it by a number like 100.

1 Like

so i would do:

script.Parent:ApplyImpulse(script.Parent.CFrame.LookVector * 100)

You would keep the assembly mass part too.

You might also need to do script.Parent:SetNetworkOwner(nil)

The boost worked, but when the boost stopped, the car goes to 0 speed and isnt able to move?

i have to jump out the car and then back into it to drive again, otherwise the car wont move after boost.

@SubtotalAnt8185

Would it be able to keep a steady speed on the chassis for like 5 seconds then remove the boost and revert it to the speed it was at?

Yes, you would need to use a while loop.

You need to set the network owner back to what it was before. You can do this with script.Parent:GetNetworkOwner().

How would I make it go at a certain speed though, because ApplyImpulse pushes the car?

Maybe you should be using LinearVelocity instead with the line constraint.

I wouldn’t be sure on how to make that

image

I have tried putting linearvelocity in, it somehow works but am not sure how to make it actually work when the chassis enters the part and activates it and make it go the direction the car is in