Hey guys!

So here's the situation.. I've got this truck. It used to run fine now it doesn't. It's not throwing any errors at me. The script is enabled. Im only working with a vehicle seat here so it shouldn't be too difficult right??

Then why on Earth is it not recognizing ANYTHING I tell it to check.. anyway here it is and let me know if you have any ideas.

seat = script.Parent
engine = script.Parent.Parent.Engine
MaxSpeed = seat.MaxSpeed



function constant(engine)
    seat.BodyVelocity.velocity=engine.CFrame.lookVector*MaxSpeed
end

function check()
    if (script.Parent.Throttle==1) then
        MaxSpeed=40
        seat.BodyVelocity.maxForce=Vector3.new(5e+005,0, 5e+005)

    elseif(script.Parent.Throttle==-1) then
	MaxSpeed=-40 ---Reverse 
        seat.BodyVelocity.maxForce=Vector3.new(5e+005, 0, 5e+005)	 					
    
    elseif(script.Parent.Throttle==0) then
        seat.BodyVelocity.maxForce=Vector3.new(0,0,0)
        MaxSpeed = 0 -- leave alone
    end
end

    if (script.Parent.Steer==-1) then
	 script.Parent.Turn.angularvelocity=Vector3.new(0,1,0) 

    elseif (script.Parent.Steer==1) then
	  script.Parent.Turn.angularvelocity=Vector3.new(0,-1,0)

    elseif (script.Parent.Steer==0) then
	script.Parent.Turn.angularvelocity=Vector3.new(0,0,0)

end


while true do
    wait()
    check()
    constant(script.Parent)
end

I'd almost rather it throw errors and me.. so I could at least know what is wrong.

Anyway, G'day

G7

2 comments

0

WHat do you mean it "isn't checking anything"? Could you please elaborate? is it just skipping past the code?

0

Yeah, the Vector math on line:14 (5e+005) or (0.0005) was not enough to power the truck. Had to pump up those rookie numbers. Now I just gotta get it to stop flippin.