Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mortar = Instance.new("Model", workspace)
- mortar.Name = "Mortar"
- local leg2 = Instance.new("Part", mortar)
- leg2.FormFactor = Enum.FormFactor.Custom
- leg2.TopSurface = Enum.SurfaceType.Smooth
- leg2.Anchored = true
- leg2.Size = Vector3.new(0.3, 3, 0.3)
- leg2.Name = "Leg2"
- leg2.CFrame = CFrame.new(-35.54, 1.104, -203.893)* CFrame.Angles(2.6276757717133, -0.85311818122864, 3.0894958972931)
- leg2.BrickColor = BrickColor.new("Dark stone grey")
- leg2.Friction = 0.3
- leg2.BottomSurface = Enum.SurfaceType.Smooth
- local launcher = Instance.new("Part", mortar)
- launcher.FormFactor = Enum.FormFactor.Plate
- launcher.CanCollide = false
- launcher.TopSurface = Enum.SurfaceType.Smooth
- launcher.Anchored = true
- launcher.Size = Vector3.new(4, 0.8, 1)
- launcher.Name = "Launcher"
- launcher.CFrame = CFrame.new(-35.946, 1.917, -205.107)* CFrame.Angles(0.87163752317429, 0.70191836357117, -2.2266321182251)
- launcher.BrickColor = BrickColor.new("Dark stone grey")
- launcher.Friction = 0.3
- launcher.BottomSurface = Enum.SurfaceType.Smooth
- local mesh = Instance.new("SpecialMesh", launcher)
- mesh.Scale = Vector3.new(0.7, 1, 1)
- mesh.MeshId = "rbxasset://fonts/rocketlauncher.mesh"
- mesh.MeshType = Enum.MeshType.FileMesh
- local fire = Instance.new("ClickDetector", launcher)
- fire.Name = "Fire"
- fire.MaxActivationDistance = 5
- local explosion = Instance.new("Sound", launcher)
- explosion.Name = "Explosion"
- explosion.Volume = 1
- explosion.SoundId = "http://www.roblox.com/asset/?id=133680244"
- local base = Instance.new("Part", mortar)
- base.FormFactor = Enum.FormFactor.Custom
- base.TopSurface = Enum.SurfaceType.Smooth
- base.Anchored = true
- base.Size = Vector3.new(3, 3, 0.2)
- base.Name = "Base"
- base.CFrame = CFrame.new(-35.61, 0.2, -204.85)* CFrame.Angles(-1.5707963705063, 0, -2.2207961082458)
- base.BrickColor = BrickColor.new("Dark stone grey")
- base.Friction = 0.3
- base.BottomSurface = Enum.SurfaceType.Smooth
- local mesh_2 = Instance.new("SpecialMesh", base)
- mesh_2.Scale = Vector3.new(3, 3, 3)
- mesh_2.MeshId = "http://www.roblox.com/asset/?id=3270017"
- mesh_2.MeshType = Enum.MeshType.FileMesh
- local pack = Instance.new("Part", mortar)
- pack.FormFactor = Enum.FormFactor.Custom
- pack.TopSurface = Enum.SurfaceType.Smooth
- pack.Anchored = true
- pack.Size = Vector3.new(0.6, 1, 1.25)
- pack.Name = "Pack"
- pack.CFrame = CFrame.new(-35.384, 0.6, -205.809)* CFrame.Angles(-3.139374256134, -1.2207971811295, -3.1397440433502)
- pack.BrickColor = BrickColor.new("Medium green")
- pack.Friction = 0.3
- pack.BottomSurface = Enum.SurfaceType.Smooth
- local carry = Instance.new("ClickDetector", pack)
- carry.Name = "Carry"
- carry.MaxActivationDistance = 8
- local leg = Instance.new("Part", mortar)
- leg.FormFactor = Enum.FormFactor.Custom
- leg.TopSurface = Enum.SurfaceType.Smooth
- leg.Anchored = true
- leg.Size = Vector3.new(0.3, 3, 0.3)
- leg.Name = "Leg"
- leg.CFrame = CFrame.new(-34.669, 1.104, -205.038)* CFrame.Angles(2.6276757717133, -0.85311818122864, 2.3894958496094)
- leg.BrickColor = BrickColor.new("Dark stone grey")
- leg.Friction = 0.3
- leg.BottomSurface = Enum.SurfaceType.Smooth
- local seat = Instance.new("VehicleSeat", mortar)
- seat.Friction = 0.3
- seat.BottomSurface = Enum.SurfaceType.SteppingMotor
- seat.CanCollide = false
- seat.Transparency = 1
- seat.TopSurface = Enum.SurfaceType.SteppingMotor
- seat.CFrame = CFrame.new(-37.61, 0.325, -206.85)* CFrame.Angles(-3.1410813331604, -0.57079440355301, -3.1406464576721)
- seat.Size = Vector3.new(2, 1, 2)
- seat.FrontSurface = Enum.SurfaceType.SteppingMotor
- seat.Name = "Seat"
- seat.HeadsUpDisplay = false
- local bodyposition = Instance.new("BodyPosition", seat)
- bodyposition.maxForce = Vector3.new(400000, 400000, 400000)
- bodyposition.position = Vector3.new(-37.61, 0.2, -206.85)
- local bodygyro = Instance.new("BodyGyro", seat)
- bodygyro.maxTorque = Vector3.new(400000, 400000, 400000)
- bodygyro.cframe = CFrame.new(-35.61, 0.2, -204.85)* CFrame.Angles(-3.1410813331604, -0.57079607248306, -3.1406464576721)
- Turn = 0
- Angle = 5
- L = mortar.Launcher
- B = mortar.Base
- Seat = mortar.Seat
- Ready = true
- Packed = false
- --Hit,Pos = game.Workspace:FindPartOnRay(Ray.new((Gun.CFrame*CFrame.new(0,0,-1.5)).p,(ShootTo-Gun.Position)),Gun)
- --CFrame.new(0,-0.5,1) * CFrame.Angles(-1.57,0,0)
- function Framer()
- L.CFrame = ((B.CFrame * CFrame.new(0,-1.3,0.5) * CFrame.Angles(-1.57,0,1.57)) * CFrame.Angles(0,0.5+((Angle-5)*0.025),0)) * CFrame.new(-1.5,0,0)
- mortar.Leg.CFrame = (mortar.Base.CFrame * CFrame.new(-0.7,0.5,1.3) * CFrame.Angles(1.9,0,-0.35))* CFrame.new((Angle-5)*0.025,-(Angle-5)*0.08,0)
- mortar.Leg2.CFrame = (mortar.Base.CFrame * CFrame.new(0.7,0.5,1.3) * CFrame.Angles(1.9,0,0.35))* CFrame.new(-(Angle-5)*0.025,-(Angle-5)*0.08,0)
- mortar.Pack.CFrame = mortar.Base.CFrame * CFrame.new(-0.9,-0.4,0.4) * CFrame.Angles(1.57,0.3,-0)
- end
- Framer()
- mortar.Seat.BodyGyro.cframe = B.CFrame * CFrame.Angles(1.57,-1,0)
- mortar.Seat.BodyPosition.position = (B.CFrame * CFrame.new(-2,-2,0)).p
- L.Fire.MouseClick:connect(function()
- if Ready and not Packed then
- Ready = false
- Hit,Pos = game.Workspace:FindPartOnRay(Ray.new(B.CFrame * CFrame.new(0,Angle*5,150).p,((B.CFrame * CFrame.new(0,Angle*20,-250).p)-B.Position)),mortar.Launcher)
- wait(0.15)
- E = Instance.new("Explosion")
- E.Position = Pos
- E.BlastRadius = 7
- E.Parent = game.Workspace
- mortar.Launcher.Explosion:Play()
- wait(3.5)
- Ready = true
- elseif Ready and Packed then
- if TargetPlayer.Character.Torso.Velocity.Y < 0.25 and TargetPlayer.Character.Torso.Velocity.Y > -0.25 then
- B.CFrame = TargetPlayer.Character.Torso.CFrame * CFrame.new(0,-2.8,-4) * CFrame.Angles(-1.57,0,0)
- mortar.Base.Transparency = 0
- mortar.Pack.Transparency = 0
- mortar.Leg.Transparency = 0
- mortar.Leg2.Transparency = 0
- mortar.Base.CanCollide = true
- mortar.Pack.CanCollide = true
- mortar.Leg.CanCollide = true
- mortar.Leg2.CanCollide = true
- w:remove()
- L.Anchored = true
- Framer()
- wait()
- mortar.Seat.BodyGyro.cframe = B.CFrame * CFrame.Angles(1.57,-1,0)
- mortar.Seat.BodyPosition.position = (B.CFrame * CFrame.new(-2,-2,0)).p
- Packed = false
- end
- end
- end)
- mortar.Pack.Carry.MouseClick:connect(function()
- if not Packed then
- if mortar.Seat:FindFirstChild("SeatWeld") == nil then
- Packed = true
- mortar.Base.Transparency = 1
- mortar.Pack.Transparency = 1
- mortar.Leg.Transparency = 1
- mortar.Leg2.Transparency = 1
- mortar.Base.CanCollide = false
- mortar.Pack.CanCollide = false
- mortar.Leg.CanCollide = false
- mortar.Leg2.CanCollide = false
- L.Anchored = false
- Seat.BodyPosition.position = Vector3.new(0,0,0)
- Dist = 8
- TargetPlayer = nil
- Players = game.Players:GetChildren()
- for i = 1,#Players do
- if Players[i].Character ~= nil then
- if (Players[i].Character.Torso.Position-L.Position).magnitude < Dist then
- Dist = (Players[i].Character.Torso.Position-L.Position).magnitude
- TargetPlayer = Players[i]
- end
- end
- end
- w = Instance.new("Weld")
- w.Parent = TargetPlayer.Character.Torso
- w.Part0 = w.Parent
- w.Part1 = L
- w.C0 = CFrame.new(0.7,0.5,0.3) * CFrame.Angles(-0.3,0,1.27)
- end
- end
- end)
- mortar.Seat.ChildAdded:connect(function()
- mortar.Seat.SeatWeld.C0 = CFrame.new(0,-0.5,1) * CFrame.Angles(-1.57,0,0)
- mortar.Seat.BodyGyro.cframe = B.CFrame * CFrame.Angles(1.57,-1,0)
- mortar.Seat.BodyPosition.position = (B.CFrame * CFrame.new(-2,-2,0)).p
- end)
- mortar.Seat.Changed:connect(function()
- if Turn < 14 and Turn > -14 then
- Turn = Turn + (mortar.Seat.Steer)
- print(Turn)
- if Turn == 14 then
- Turn = 13
- mortar.Base.CFrame = mortar.Base.CFrame * CFrame.Angles(0,0,mortar.Seat.Steer*0.05)
- elseif Turn == -14 then
- Turn = -13
- mortar.Base.CFrame = mortar.Base.CFrame * CFrame.Angles(0,0,mortar.Seat.Steer*0.05)
- end
- mortar.Base.CFrame = mortar.Base.CFrame * CFrame.Angles(0,0,-mortar.Seat.Steer*0.05)
- Framer()
- end
- if Angle < 15 and Angle > 2 then
- Angle = Angle + (mortar.Seat.Throttle)
- print(Angle)
- if Angle == 15 then
- Angle = 14
- elseif Angle == 2 then
- Angle = 3
- end
- Framer()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement