local r=script.Parent local f=r.Configuration local a=nil local m=false local g=0 local j=0 r.ChildAdded:connect(function(m)if m.className=="\087\101\108\100"and m.Name=="\083\101\097\116\087\101\108\100"then local g=m.Part1.Parent local j=game.Players:FindFirstChild(g.Name)if j~=nil then a=j r.ChildRemoved:connect(function(r)if r==m then a=nil end end)r.BodyVelocity.maxForce=Vector3.new(1,1,1)*f.MaxForce.Value r.BodyGyro.maxTorque=Vector3.new(1,1,1)*50000 local g=0 local n=r.ScreenGui:clone()n.Parent=j.PlayerGui n.Frame.Faster.MouseButton1Click:connect(function()g=math.min(g+f.MaxSpeed.Value/20,f.MaxSpeed.Value)n.Frame.Speed.Text=math.floor(g)end)n.Frame.Slower.MouseButton1Click:connect(function()g=math.max(g-f.MaxSpeed.Value/20,0)n.Frame.Speed.Text=math.floor(g)end)while a==j do r.BodyVelocity.velocity=r.CFrame.lookVector*g wait()end n:remove()r.BodyVelocity.velocity=Vector3.new(0,0,0)r.BodyVelocity.maxForce=Vector3.new(0,0,0)r.BodyGyro.maxTorque=Vector3.new(0,0,0)end end end)r.Changed:connect(function()if not m then local a=r.Steer local n=r.Throttle m=true while a~=0 or n~=0 do j=j-r.Steer*f.TurnSpeed.Value g=g-r.Throttle*f.TurnSpeed.Value r.BodyGyro.cframe=(CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(j),0))*CFrame.Angles(math.rad(g),0,0)wait()end m=false end end)

local seat=script.Parent
local data=seat.Configuration
local owner=nil
local running=false
local x=0
local y=0

seat.ChildAdded:connect(
function(w)
if w.className=="Weld" and w.Name=="SeatWeld" then
local char=w.Part1.Parent
local player=game.Players:FindFirstChild(char.Name)
if player~=nil then
owner=player
seat.ChildRemoved:connect(
function(w2)
if w2==w then
owner=nil
end
end
)
seat.BodyVelocity.maxForce=Vector3.new(1,1,1)*data.MaxForce.Value
seat.BodyGyro.maxTorque=Vector3.new(1,1,1)*50000
local spd=0
local gui=seat.ScreenGui:clone()
gui.Parent=player.PlayerGui
gui.Frame.Faster.MouseButton1Click:connect(
function()
spd=math.min(spd+data.MaxSpeed.Value/20,data.MaxSpeed.Value)
gui.Frame.Speed.Text=math.floor(spd)
end
)
gui.Frame.Slower.MouseButton1Click:connect(
function()
spd=math.max(spd-data.MaxSpeed.Value/20,0)
gui.Frame.Speed.Text=math.floor(spd)
end
)
while owner==player do
seat.BodyVelocity.velocity=seat.CFrame.lookVector*spd
wait()
end
gui:remove()
seat.BodyVelocity.velocity=Vector3.new(0,0,0)
seat.BodyVelocity.maxForce=Vector3.new(0,0,0)
seat.BodyGyro.maxTorque=Vector3.new(0,0,0)
end
end
end
)

seat.Changed:connect(
function()
if not running then
local cur=seat.Steer
local cur2=seat.Throttle
running=true
while (cur~=0 or cur2~=0) do
y=y-seat.Steer*data.TurnSpeed.Value
x=x-seat.Throttle*data.TurnSpeed.Value
seat.BodyGyro.cframe=CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(y),0)*CFrame.Angles(math.rad(x),0,0)
wait()
end
running=false
end
end
)
