Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Make this vehicle move backwards? BodyVelocity and such

So, trying to edit a free model vehicle, as in change lots around. So far everything;s been good but it just does not move backwards. Like i'm baffled by it I don't know what reason there is for it to not be moving. It goes forwards and turns, does not move backwards though. Here is some code, that affects the driving:

velocity = script.Parent.BodyVelocity
force = script.Parent.BodyForce
gear = script.Parent.Parent.Model.VehicleSeat.Gear
velocity.Parent = nil

while true do
wait()
	if seat.Throttle == 1 then
		script.Parent.Parent.trail.t1.Smoke.Enabled = false
		script.Parent.Parent.trail.t2.Smoke.Enabled = false
		gear.Value = 3
		script.Parent.Parent.trail.Trail.Enabled = false
		velocity.Parent = nil
		if gear.Value == -1 then
			force.force = seat.CFrame.lookVector * -30000
		elseif gear.Value == 1 then
			force.force = seat.CFrame.lookVector * 35000
		elseif gear.Value == 2 then
			force.force = seat.CFrame.lookVector * 37000
		elseif gear.Value == 3 then
			force.force = seat.CFrame.lookVector * 39000
		elseif gear.Value == 4 then
			force.force = seat.CFrame.lookVector *41000
		elseif gear.Value == 5 then
			force.force = seat.CFrame.lookVector * 43000
		end
	elseif seat.Throttle == 0 then
		gear.Value = 0
		script.Parent.Parent.trail.t1.Smoke.Enabled = false
		script.Parent.Parent.trail.t2.Smoke.Enabled = false
		velocity.Parent = script.Parent
		force.force = seat.CFrame.lookVector * 0
	elseif seat.Throttle == -1 then
		gear.Value = -1
		script.Parent.Parent.trail.Trail.Enabled = true
		script.Parent.Parent.trail.t1.Smoke.Enabled = true
		script.Parent.Parent.trail.t2.Smoke.Enabled = true
		velocity.Parent = nil
		force.force = seat.CFrame.lookVector * -30000
	end
end

Mainly the bottom of it, where if the throttle is -1. Character is on a vehicle seat. Should that not just make the vehicle move backwards? It's the same as all the lines making it move forwards(which work) why does it just sit still when holding S? Any help is appreciated.

1 comment

0

No one wants to fix your free models

1 answer

Where is the variable for seat? Seat isn't a everyday global argument like script or Parent.

If it still doesn't work after that then I don't know, but you are missing a variable.

This discussion is preserved as it was. New answers, comments, and votes are closed.