Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(1)
- owner = game.Players.bobopopcornboy
- Folder = Instance.new('Model')
- Folder.Parent = workspace
- Folder.Name = "Tank"
- pos = Vector3.new(0,0.5,0)
- ro = Vector3.new(0,180,0)
- Wheel = Instance.new('Part')
- Wheel.Parent = Folder
- Wheel.Size = Vector3.new(22.9874324798584,4.138504981994629,12.38792896270752)
- Wheel.Position = Vector3.new(pos.X + 16.371414184570312,pos.Y + 1.8168296813964844,pos.Z + -0.48949432373046875)
- Wheel.Rotation = Vector3.new(ro.X + -180,ro.Y + 0,ro.Z + -180)
- Base = Instance.new('Part')
- Base.Parent = Folder
- Base.Size = Vector3.new(24.348304748535156,5.756950378417969,12.505230903625488)
- Base.Position = Vector3.new(pos.X + 16.490482330322266,pos.Y + 3.610198974609375,pos.Z + -0.5)
- Base.Rotation = Vector3.new(ro.X + -180,ro.Y + 0,ro.Z + -180)
- Head = Instance.new('Part')
- Head.Parent = Folder
- Head.Size = Vector3.new(11.290436744689941,4.064630508422852,8.793956756591797)
- Head.Position = Vector3.new(pos.X + 17.950275421142578,pos.Y + 8.282885551452637,pos.Z + -0.2089996337890625)
- Head.Rotation = Vector3.new(ro.X + -180,ro.Y + 0,ro.Z + -180)
- Gun = Instance.new('Part')
- Gun.Parent = Folder
- Gun.Size = Vector3.new(10.676332473754883,1.6956206560134888,2.9556143283843994)
- Gun.Position = Vector3.new(pos.X + 7.673534393310547,pos.Y + 7.329769134521484,pos.Z + -0.38297271728515625)
- Gun.Rotation = Vector3.new(ro.X + -180,ro.Y + 0,ro.Z + -180)
- Tread = Instance.new('Part')
- Tread.Parent = Folder
- Tread.Size = Vector3.new(23.28107261657715,4.452668190002441,12.106224060058594)
- Tread.Position = Vector3.new(pos.X + 16.355464935302734,pos.Y + 1.7263336181640625,pos.Z + -0.48949432373046875)
- Tread.Rotation = Vector3.new(ro.X + -180,ro.Y + 0,ro.Z + -180)
- Seat = Instance.new('VehicleSeat')
- Seat.Parent = Folder
- Seat.Size = Vector3.new(3,1,3)
- Seat.Position = Vector3.new(pos.X + 19.09549331665039,pos.Y + 9.815200805664062,pos.Z + -0.31202125549316406)
- Seat.Rotation = Vector3.new(ro.X + 0,ro.Y + -90,ro.Z + 0)
- Seat.Transparency = 1
- --Mesh
- Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = Gun
- Mesh.MeshId = "rbxassetid://1379683528"
- Mesh.TextureId = "rbxassetid://1379698208"
- Mesh.Scale = Vector3.new(2.22, 2.22, 2.22) --done
- Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = Head
- Mesh.MeshId = "rbxassetid://1379682889"
- Mesh.TextureId = "rbxassetid://1379698208"
- Mesh.Scale = Vector3.new(2.22, 2.22, 2.22) --done
- Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = Base
- Mesh.MeshId = "rbxassetid://1379684325"
- Mesh.TextureId = "rbxassetid://1379698208"
- Mesh.Scale = Vector3.new(2.22, 2.22, 2.22) --done
- Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = Tread
- Mesh.MeshId = "rbxassetid://1379685716"
- Mesh.TextureId = "rbxassetid://1379699159"
- Mesh.Scale = Vector3.new(2.22, 2.22, 2.22) --done
- Mesh = Instance.new("SpecialMesh")
- Mesh.Parent = Wheel
- Mesh.MeshId = "rbxassetid://1379684915"
- Mesh.TextureId = "rbxassetid://1379698208"
- Mesh.Scale = Vector3.new(2.23, 2.23, 2.23) --done
- --Welds
- --[[Not Use
- co = Instance.new("WeldConstraint")
- co.Parent = Folder
- co.Part0 = Base
- co.Part1 = Head
- co = Instance.new("WeldConstraint")
- co.Parent = Folder
- co.Part0 = Head
- co.Part1 = Gun
- ]]--
- co = Instance.new("WeldConstraint")
- co.Parent = Folder
- co.Part0 = Wheel
- co.Part1 = Tread
- co = Instance.new("WeldConstraint")
- co.Parent = Folder
- co.Part0 = Base
- co.Part1 = Wheel
- co = Instance.new("WeldConstraint")
- co.Parent = Folder
- co.Part0 = Head
- co.Part1 = Seat
- --pivots
- At1 = Instance.new("Attachment")
- At1.Parent = Base
- At1.Orientation = Vector3.new(0, 0, 90)
- At1.Position = Vector3.new(1.213, 2.832, 0.1)
- At2 = Instance.new("Attachment")
- At2.Parent = Head
- At2.Orientation = Vector3.new(-180, -180, -90)
- At2.Position = Vector3.new(1, -2.032, 0)
- HBRotation = Instance.new("HingeConstraint")
- HBRotation.Attachment0 = At1
- HBRotation.Attachment1 = At2
- HBRotation.Parent = Folder
- HBRotation.ActuatorType = Enum.ActuatorType.Servo
- HBRotation.ServoMaxTorque = math.huge
- HBRotation.AngularResponsiveness = math.huge
- HBRotation.AngularSpeed = math.huge
- At3 = Instance.new("Attachment")
- At3.Parent = Gun
- At3.Orientation = Vector3.new(-90, -90, 0)
- At3.Position = Vector3.new(5.277, -0.079, 0.174)
- At4 = Instance.new("Attachment")
- At4.Parent = Head
- At4.Orientation = Vector3.new(-90, -90, 0)
- At4.Position = Vector3.new(-5, -1.032, 0)
- HGRotation = Instance.new("HingeConstraint")
- HGRotation.Attachment0 = At3
- HGRotation.Attachment1 = At4
- HGRotation.Parent = Folder
- HGRotation.ActuatorType = Enum.ActuatorType.Servo
- HGRotation.ServoMaxTorque = math.huge
- HGRotation.AngularResponsiveness = math.huge
- HGRotation.AngularSpeed = math.huge
- event = Instance.new("RemoteEvent")
- event.Parent = Folder
- event.Name = "event"
- TLP = Instance.new('Part')
- TLP.Parent = Folder
- TLP.Size = Vector3.new(23.5,1,2.5)
- TLP.Position = Vector3.new(pos.X + 16.566329956054688,pos.Y + 3.4886741638183594,pos.Z + 4.502614974975586)
- TLP.Rotation = Vector3.new(ro.X + 0,ro.Y + 0,ro.Z + 0)
- TRP = Instance.new('Part')
- TRP.Parent = Folder
- TRP.Size = Vector3.new(23.5,1,2.5)
- TRP.Position = Vector3.new(pos.X + 16.566329956054688,pos.Y + 3.4886741638183594,pos.Z + -5.497385025024414)
- TRP.Rotation = Vector3.new(ro.X + 0,ro.Y + 0,ro.Z + 0)
- TRP.Transparency = 1
- TLP.Transparency = 1
- TR = Instance.new('BodyThrust',TRP)
- TL = Instance.new('BodyThrust',TLP)
- co = Instance.new("WeldConstraint")
- co.Parent = Folder
- co.Part0 = Wheel
- co.Part1 = TRP
- co = Instance.new("WeldConstraint")
- co.Parent = Folder
- co.Part0 = Wheel
- co.Part1 = TLP
- lscript = owner.PlayerGui.tankLocal
- local mass = 0
- for i, v in pairs(Folder:GetChildren()) do
- if v:IsA("BasePart") then
- mass = mass + (v:GetMass() * 196.2)
- end
- end
- Seat.Changed:Connect(function(prop)
- if prop == "Occupant" then
- if Seat.Occupant then
- local lc = lscript:Clone()
- lc.Parent = game.Players:GetPlayerFromCharacter(Seat.Occupant.Parent).PlayerGui
- lc.Name = "CLONE"
- else
- end
- end
- end)
- event.OnServerEvent:Connect(function(plyr,target,hit)
- if target.Parent:FindFirstChild("Humanoid") then
- target.Parent.Humanoid.Health = 0
- end
- local x1 = At1.WorldPosition.X
- local y1 = At1.WorldPosition.Z
- local x2 = hit.X
- local y2 = hit.Z
- local dx = x1 - x2
- local dy = y1 - y2
- local angle = math.atan2(dy,dx)
- angle = math.deg(-angle)
- HBRotation.TargetAngle = angle - Base.Rotation.Y
- --explosion
- local tnt = Instance.new("Explosion")
- tnt.Parent = workspace
- tnt.BlastRadius = 100
- tnt.Position = hit.Position
- tnt.BlastPressure = 2000
- tnt.DestroyJointRadiusPercent = 0
- tnt.ExplosionType = Enum.ExplosionType.Craters
- end)
- while wait() do
- local dir = Seat.Steer
- local fo = Seat.Throttle
- local f = mass/2
- if dir == 0 then
- TR.Force =Vector3.new(fo*f,0,0)
- TL.Force = Vector3.new(fo*f,0,0)
- if fo == 0 then
- TR.Force = Vector3.new(0,0,0)
- TL.Force = Vector3.new(0,0,0)
- TRP.Velocity = Vector3.new()
- TLP.Velocity = Vector3.new()
- end
- else
- if dir == -1 then
- TR.Force = Vector3.new(f,0,0)
- TL.Force = Vector3.new(-f,0,0)
- else
- TR.Force = Vector3.new(-f,0,0)
- TL.Force = Vector3.new(f,0,0)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement