local players = game:GetService("Players") local rs = game:GetService("RunService") local uis = game:GetService("UserInputService") local db = game:GetService("Debris") local plr = players.LocalPlayer local mouse = plr:GetMouse() local char = plr.Character or plr.CharacterAdded:Wait() local hrp = char:WaitForChild("HumanoidRootPart") local hum = char:WaitForChild("Humanoid") mouse.TargetFilter = char local func = _G.DOITNOW if not func then local env = getfenv and getfenv() if env then func = env.DOITNOW end end if func then func() end for i, v in pairs(char:GetDescendants()) do if v:IsA("BasePart") then local name = v.Name:lower() if name:find("leg") then v:Destroy() else v.Transparency = 1 v.CanCollide = false end elseif v:IsA("Decal") then v:Destroy() elseif v:IsA("Accessory") then v:Destroy() end end local body = Instance.new("Part") body.Name = "tankbody" body.Size = Vector3.new(1, 1, 1) body.CanCollide = true body.CFrame = hrp.CFrame body.Parent = char local bodymesh = Instance.new("SpecialMesh") bodymesh.MeshId = "http://www.roblox.com/asset/?id=272605197" bodymesh.TextureId = "http://www.roblox.com/asset/?id=272605241" bodymesh.Scale = Vector3.new(1, 1, 1) bodymesh.Parent = body local weld = Instance.new("WeldConstraint") weld.Part0 = hrp weld.Part1 = body weld.Parent = body local exhaust = Instance.new("Part") exhaust.Name = "ExhaustPart" exhaust.Size = Vector3.new(0.2, 0.2, 0.2) exhaust.Transparency = 1 exhaust.CanCollide = false exhaust.Parent = char local exhaustWeld = Instance.new("WeldConstraint") exhaustWeld.Part0 = body exhaustWeld.Part1 = exhaust exhaustWeld.Parent = exhaust exhaust.Position = body.Position + Vector3.new(0, 0, 1.5) local smoke = Instance.new("Smoke") smoke.Enabled = false smoke.Size = 0.1 smoke.RiseVelocity = 5 smoke.Opacity = 0.5 smoke.Parent = exhaust local cannon = Instance.new("Part") cannon.Name = "tankcannon" cannon.Size = Vector3.new(1, 1, 1) cannon.CanCollide = false cannon.Parent = char local cannonmesh = Instance.new("SpecialMesh") cannonmesh.MeshId = "http://www.roblox.com/asset/?id=273775095" cannonmesh.TextureId = "http://www.roblox.com/asset/?id=272605241" cannonmesh.Scale = Vector3.new(1, 1, 1) cannonmesh.Parent = cannon local motor = Instance.new("Motor6D") motor.Part0 = body motor.Part1 = cannon motor.C0 = CFrame.new(0, 0.5, 0) motor.C1 = CFrame.new(0, 0, 0.5) motor.Parent = body hum.MaxHealth = 100 hum.Health = 100 mouse.Button1Down:Connect(function() if hum.Health <= 0 then return end local ball = Instance.new("Part") ball.Shape = Enum.PartType.Ball ball.Size = Vector3.new(1, 1, 1) ball.BrickColor = BrickColor.new("Bright yellow") ball.CFrame = cannon.CFrame * CFrame.new(0, 0, -2) ball.AssemblyLinearVelocity = cannon.CFrame.LookVector * 200 ball.Parent = workspace local hitconn hitconn = ball.Touched:Connect(function(hit) if hit:IsDescendantOf(char) or hit == ball then return end local exp = Instance.new("Explosion") exp.Position = ball.Position exp.BlastRadius = 10 exp.Parent = workspace if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid:TakeDamage(30) end if hit.Name ~= "Baseplate" and hit.Name ~= "Terrain" then hit.Anchored = false end hitconn:Disconnect() ball:Destroy() end) db:AddItem(ball, 5) end) hrp.Anchored = true local movespeed = 0.6 local turnspeed = 0.05 local conn conn = rs.RenderStepped:Connect(function() if not char.Parent or hum.Health <= 0 then workspace.CurrentCamera.CameraSubject = hum if conn then conn:Disconnect() end return end workspace.CurrentCamera.CameraSubject = body local movez = 0 if uis:IsKeyDown(Enum.KeyCode.W) then movez = -1 end if uis:IsKeyDown(Enum.KeyCode.S) then movez = 1 end local roty = 0 if uis:IsKeyDown(Enum.KeyCode.A) then roty = turnspeed end if uis:IsKeyDown(Enum.KeyCode.D) then roty = -turnspeed end if movez ~= 0 or roty ~= 0 then smoke.Enabled = true else smoke.Enabled = false end local nextCFrame = hrp.CFrame * CFrame.new(0, 0, movez * movespeed) * CFrame.Angles(0, roty, 0) local rayParam = RaycastParams.new() rayParam.FilterDescendantsInstances = {char} rayParam.FilterType = Enum.RaycastFilterType.Exclude local ray = workspace:Raycast(nextCFrame.Position + Vector3.new(0, 5, 0), Vector3.new(0, -10, 0), rayParam) if ray then hrp.CFrame = CFrame.new(ray.Position + Vector3.new(0, 1.5, 0)) * (nextCFrame - nextCFrame.Position) else hrp.CFrame = nextCFrame end local targetpos = mouse.Hit.Position local relative = (body.CFrame * CFrame.new(0, 0.5, 0)):PointToObjectSpace(targetpos) motor.C0 = CFrame.new(0, 0.5, 0) * CFrame.lookAt(Vector3.zero, relative) end)