Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local seat = script.Parent
- local bot = seat.Parent
- local han = bot.Handle
- local blade = bot.Blade
- local tor = bot.Tor
- local bg = tor.BodyGyro
- local bv = tor.BodyVelocity
- local ra = bot.RArm
- local la = bot.LArm
- local rl = bot.RLeg
- local ll = bot.LLeg
- local motor = "Motor6D"
- local scale = 20
- local rs = Instance.new(motor)
- rs.Name = "Right Shoulder"
- rs.MaxVelocity = 20/45*0.1
- rs.Part0 = tor
- rs.Part1 = ra
- rs.C0 = CFrame.new(1*scale, 0.5*scale, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- rs.C1 = CFrame.new(-0.5*scale, 0.5*scale, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- rs.Parent = tor
- local ls = Instance.new(motor)
- ls.Name = "Left Shoulder"
- ls.MaxVelocity = 0.1
- ls.Part0 = tor
- ls.Part1 = la
- ls.C0 = CFrame.new(-1*scale, 0.5*scale, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- ls.C1 = CFrame.new(0.5*scale, 0.5*scale, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- ls.Parent = tor
- local rh = Instance.new(motor)
- rh.Name = "Right Hip"
- rh.MaxVelocity = 0.1
- rh.Part0 = tor
- rh.Part1 = rl
- rh.C0 = CFrame.new(1*scale, -1*scale, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- rh.C1 = CFrame.new(0.5*scale, 1*scale, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
- rh.Parent = tor
- local lh = Instance.new(motor)
- lh.Name = "Left Hip"
- lh.MaxVelocity = 0.1
- lh.Part0 = tor
- lh.Part1 = ll
- lh.C0 = CFrame.new(-1*scale, -1*scale, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- lh.C1 = CFrame.new(-0.5*scale, 1*scale, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
- lh.Parent = tor
- for i = 1, 2 do
- local w = Instance.new("Weld")
- w.Part0 = ra
- if i == 1 then
- w.Part1 = han
- else
- w.Part1 = blade
- end
- w.C1 = (CFrame.new(0,-0.875*scale,-1.75*scale)*CFrame.Angles(0,math.rad(180),0)):inverse()
- w.Parent = tor
- end
- function Down(key)
- if key == "Up" then
- return seat.Throttle == 1
- elseif key == "Down" then
- return seat.Throttle == -1
- elseif key == "Right" then
- return seat.Steer == 1
- elseif key == "Left" then
- return seat.Steer == -1
- end
- end
- local moving
- local last = 0
- local add = 1
- while true do
- bv.velocity = tor.CFrame.lookVector*16*scale*seat.Throttle
- bg.cframe = tor.CFrame*CFrame.Angles(0,math.rad(seat.Steer*-10),0)
- if seat.Throttle ~= 0 then
- if last == 0 then
- ls.DesiredAngle = math.rad(-45)
- rs.DesiredAngle = math.rad(70)
- lh.DesiredAngle = math.rad(45)
- rh.DesiredAngle = math.rad(45)
- add = 1
- elseif last == 20 then
- ls.DesiredAngle = math.rad(45)
- rs.DesiredAngle = math.rad(110)
- lh.DesiredAngle = math.rad(-45)
- rh.DesiredAngle = math.rad(-45)
- add = -1
- end
- last = last + add
- else
- last = 0
- add = 1
- ls.DesiredAngle = math.rad(0)
- rs.DesiredAngle = math.rad(90)
- lh.DesiredAngle = 0
- rh.DesiredAngle = 0
- end
- wait()
- end
- --[[
- seat.Changed:connect(function(c)
- if c == "Steer" or c == "Throttle" then
- if c == "Steer" then
- if seat.Steer == 1 then
- onDown("Up")
- else
- onDown("Down")
- end
- else
- if seat.Throttle == 1 then
- onDown("Right")
- else
- onDown("Left")
- end
- end
- end
- end)]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement