So It’s my first time making a chassis and I realized that my script wasn’t working. When throttle == 1, nothing happens! Here’s the script:
local Seat = script.Parent
local BV = script.Parent.Parent.Base.BodyForce
local BAV = script.Parent.Parent.Base.BodyAngularVelocity
local val = 0
local function onChanged(property)
if property == "Steer" then
if Seat.Steer == 1 then
BAV.AngularVelocity = Vector3.new(0,-1,0)
elseif Seat.Steer == -1 then
BAV.AngularVelocity = Vector3.new(0,1,0)
elseif Seat.Steer == 0 then
BAV.AngularVelocity = Vector3.new(0,0,0)
end
elseif property == "Throttle" then
if Seat.Throttle == 1 then
BV.Force = Vector3.new(0,0, -script.Parent.Parent.Base.CFrame.LookVector * 45)
print(BV.Force) -- prints the force
elseif Seat.Throttle == 0 then
BV.Force = script.Parent.Parent.Base.CFrame.LookVector * 0
end
end
end
script.Parent.Changed:Connect(onChanged)
And here’s the error(printed from the print command):
All help is appreciated