Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Created with Z_Vs M2S Plugin UnionOperation,ModuleScript
- Create = function(itemClass,tabl)
- local item = Instance.new(itemClass)
- for i,v in pairs(tabl) do
- local a,b = ypcall(function() return item[i] end)
- if a then
- item[i] = tabl[i]
- end
- end
- return item
- end
- function runDummyScript(f,scri)
- local oldenv = getfenv(f)
- local newenv = setmetatable({}, {
- __index = function(_, k)
- if k:lower() == 'script' then
- return scri
- else
- return oldenv[k]
- end
- end
- })
- setfenv(f, newenv)
- ypcall(function() f() end)
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- mas.Name = "CompiledModel"
- o1 = Create("Model",{
- ["Name"] = "Jeep1",
- ["Parent"] = mas,
- })
- o2 = Create("Part",{
- ["Name"] = "Thruster",
- ["Parent"] = o1,
- ["Transparency"] = 1,
- ["Position"] = Vector3.new(-15.25, 2.50999975, 66.25),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-15.25, 2.50999975, 66.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(1, 1, 2),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- })
- o3 = Create("Weld",{
- ["Parent"] = o2,
- ["Part0"] = o17,
- ["Part1"] = o2,
- })
- o4 = Create("Weld",{
- ["Name"] = "WheelWeld",
- ["Parent"] = o2,
- ["Part0"] = o2,
- ["Part1"] = mas,
- })
- o6 = Create("Weld",{
- ["Parent"] = mas,
- ["Part0"] = o17,
- ["Part1"] = mas,
- })
- o7 = Create("Part",{
- ["Parent"] = o1,
- ["BrickColor"] = BrickColor.new("Really black"),
- ["Position"] = Vector3.new(-16.5, 2.25999975, 63.75),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-16.5, 2.25999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(5, 0.5, 0.5),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
- })
- o8 = Create("Weld",{
- ["Parent"] = o7,
- ["Part0"] = o17,
- ["Part1"] = o7,
- })
- o9 = Create("Part",{
- ["Name"] = "Thruster",
- ["Parent"] = o1,
- ["Transparency"] = 1,
- ["Position"] = Vector3.new(-15.25, 2.50999975, 61.25),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-15.25, 2.50999975, 61.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(1, 1, 2),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- })
- o10 = Create("Weld",{
- ["Parent"] = o9,
- ["Part0"] = o17,
- ["Part1"] = o9,
- })
- o11 = Create("Weld",{
- ["Name"] = "WheelWeld",
- ["Parent"] = o9,
- ["Part0"] = o9,
- ["Part1"] = mas,
- })
- o13 = Create("Weld",{
- ["Parent"] = mas,
- ["Part0"] = o17,
- ["Part1"] = mas,
- })
- o14 = Create("Part",{
- ["Name"] = "Thruster",
- ["Parent"] = o1,
- ["Transparency"] = 1,
- ["Position"] = Vector3.new(-7.75, 2.50999975, 61.25),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-7.75, 2.50999975, 61.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(1, 1, 2),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- })
- o15 = Create("Weld",{
- ["Parent"] = o14,
- ["Part0"] = o17,
- ["Part1"] = o14,
- })
- o16 = Create("Weld",{
- ["Name"] = "WheelWeld",
- ["Parent"] = o14,
- ["Part0"] = o14,
- ["Part1"] = mas,
- })
- o17 = Create("Part",{
- ["Name"] = "Chassis",
- ["Parent"] = o1,
- ["BrickColor"] = BrickColor.new("Really black"),
- ["Position"] = Vector3.new(-11.25, 2.50999975, 63.75),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-11.25, 2.50999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(4, 1, 10),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
- })
- o18 = Create("Part",{
- ["Parent"] = o1,
- ["BrickColor"] = BrickColor.new("Institutional white"),
- ["Position"] = Vector3.new(-7.75, 3.75999975, 63.75),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-7.75, 3.75999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(4, 1.5, 3),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["Color"] = Color3.new(0.972549, 0.972549, 0.972549),
- })
- o19 = Create("Weld",{
- ["Parent"] = o18,
- ["Part0"] = o17,
- ["Part1"] = o18,
- })
- o21 = Create("Weld",{
- ["Parent"] = mas,
- ["Part0"] = o17,
- ["Part1"] = mas,
- })
- o23 = Create("Weld",{
- ["Parent"] = mas,
- ["Part0"] = o17,
- ["Part1"] = mas,
- })
- o24 = Create("Part",{
- ["Name"] = "Thruster",
- ["Parent"] = o1,
- ["Transparency"] = 1,
- ["Position"] = Vector3.new(-7.75, 2.50999975, 66.25),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-7.75, 2.50999975, 66.25, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["CanCollide"] = false,
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(1, 1, 2),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- })
- o25 = Create("Weld",{
- ["Parent"] = o24,
- ["Part0"] = o17,
- ["Part1"] = o24,
- })
- o26 = Create("Weld",{
- ["Name"] = "WheelWeld",
- ["Parent"] = o24,
- ["Part0"] = o24,
- ["Part1"] = mas,
- })
- o28 = Create("Weld",{
- ["Parent"] = mas,
- ["Part0"] = o17,
- ["Part1"] = mas,
- })
- o29 = Create("Part",{
- ["Parent"] = o1,
- ["BrickColor"] = BrickColor.new("Institutional white"),
- ["Position"] = Vector3.new(-6, 3.75999975, 63.75),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-6, 3.75999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(4, 2.5, 0.5),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["Color"] = Color3.new(0.972549, 0.972549, 0.972549),
- })
- o30 = Create("Weld",{
- ["Parent"] = o29,
- ["Part0"] = o17,
- ["Part1"] = o29,
- })
- o31 = Create("Part",{
- ["Parent"] = o1,
- ["BrickColor"] = BrickColor.new("Really black"),
- ["Position"] = Vector3.new(-6, 2.25999975, 63.75),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-6, 2.25999975, 63.75, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(5, 0.5, 0.5),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
- })
- o32 = Create("Weld",{
- ["Parent"] = o31,
- ["Part0"] = o17,
- ["Part1"] = o31,
- })
- o34 = Create("Weld",{
- ["Parent"] = mas,
- ["Part0"] = o17,
- ["Part1"] = mas,
- })
- o35 = Create("Seat",{
- ["Name"] = "DriveSeat",
- ["Parent"] = o1,
- ["Position"] = Vector3.new(-10.75, 3.05999994, 63.75),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-10.75, 3.05999994, 63.75, 0, 0, 1, 0, 1, -0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(2, 0.200000003, 2),
- ["BottomSurface"] = Enum.SurfaceType.Smooth,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- })
- o36 = Create("Weld",{
- ["Parent"] = o35,
- ["Part0"] = o17,
- ["Part1"] = o35,
- })
- o37 = Create("Part",{
- ["Name"] = "Light",
- ["Parent"] = o1,
- ["BrickColor"] = BrickColor.new("Really black"),
- ["Position"] = Vector3.new(-16.6000004, 4.00999975, 62.25),
- ["Rotation"] = Vector3.new(45, 90, 0),
- ["CFrame"] = CFrame.new(-16.6000004, 4.00999975, 62.25, 2.46918255e-008, 5.96113381e-008, 1, 0.707106769, 0.707106769, -5.96113381e-008, -0.707106769, 0.707106769, -2.46918255e-008),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(1, 1, 0.5),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
- })
- o38 = Create("SurfaceGui",{
- ["Parent"] = o37,
- ["CanvasSize"] = Vector2.new(100, 100),
- })
- o39 = Create("Frame",{
- ["Parent"] = o38,
- ["Position"] = UDim2.new(0.10000000149012,0,0.10000000149012,0),
- ["Size"] = UDim2.new(0.80000001192093,0,0.80000001192093,0),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BorderSizePixel"] = 0,
- })
- o40 = Create("SurfaceLight",{
- ["Parent"] = o37,
- ["Brightness"] = 0.5,
- ["Range"] = 32,
- ["Angle"] = 60,
- })
- o41 = Create("Weld",{
- ["Parent"] = o37,
- ["Part0"] = o17,
- ["Part1"] = o37,
- })
- o42 = Create("Part",{
- ["Name"] = "Light",
- ["Parent"] = o1,
- ["BrickColor"] = BrickColor.new("Really black"),
- ["Position"] = Vector3.new(-16.6000004, 4.00999975, 65.25),
- ["Rotation"] = Vector3.new(45, 90, 0),
- ["CFrame"] = CFrame.new(-16.6000004, 4.00999975, 65.25, -2.83364479e-008, -6.84102304e-008, 1, 0.707106769, 0.707106769, 6.84102304e-008, -0.707106769, 0.707106769, 2.83364479e-008),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(1, 1, 0.5),
- ["BackSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["BottomSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["FrontSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["LeftSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["RightSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["TopSurface"] = Enum.SurfaceType.SmoothNoOutlines,
- ["Color"] = Color3.new(0.0666667, 0.0666667, 0.0666667),
- })
- o43 = Create("SurfaceGui",{
- ["Parent"] = o42,
- ["CanvasSize"] = Vector2.new(100, 100),
- })
- o44 = Create("Frame",{
- ["Parent"] = o43,
- ["Position"] = UDim2.new(0.10000000149012,0,0.10000000149012,0),
- ["Size"] = UDim2.new(0.80000001192093,0,0.80000001192093,0),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BorderSizePixel"] = 0,
- })
- o45 = Create("SurfaceLight",{
- ["Parent"] = o42,
- ["Brightness"] = 0.5,
- ["Range"] = 32,
- ["Angle"] = 60,
- })
- o46 = Create("Weld",{
- ["Parent"] = o42,
- ["Part0"] = o17,
- ["Part1"] = o42,
- })
- o47 = Create("Configuration",{
- ["Name"] = "Configurations",
- ["Parent"] = o1,
- })
- o48 = Create("NumberValue",{
- ["Name"] = "Bounce",
- ["Parent"] = o47,
- ["Value"] = 100,
- })
- o49 = Create("NumberValue",{
- ["Name"] = "Height",
- ["Parent"] = o47,
- ["Value"] = 3,
- })
- o50 = Create("NumberValue",{
- ["Name"] = "Speed",
- ["Parent"] = o47,
- ["Value"] = 80,
- })
- o51 = Create("NumberValue",{
- ["Name"] = "Suspension",
- ["Parent"] = o47,
- ["Value"] = 4,
- })
- o52 = Create("NumberValue",{
- ["Name"] = "TurnSpeed",
- ["Parent"] = o47,
- ["Value"] = 2,
- })
- o53 = Create("Script",{
- ["Name"] = "CarScript",
- ["Parent"] = o1,
- })
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- --Scripted by DermonDarble
- local car = script.Parent
- local stats = car.Configurations
- local Raycast = require(script.RaycastModule)
- local mass = 0
- for i, v in pairs(car:GetChildren()) do
- if v:IsA("BasePart") then
- mass = mass + (v:GetMass() * 196.2)
- end
- end
- local bodyPosition = Instance.new("BodyPosition", car.Chassis)
- bodyPosition.MaxForce = Vector3.new()
- local bodyGyro = Instance.new("BodyGyro", car.Chassis)
- bodyGyro.MaxTorque = Vector3.new()
- local function UpdateThruster(thruster)
- -- Raycasting
- local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
- local thrusterHeight = (position - thruster.Position).magnitude
- -- Wheel
- local wheelWeld = thruster:FindFirstChild("WheelWeld")
- wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
- -- Wheel turning
- local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
- local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
- if offset.Z < 0 then
- local direction = 1
- if speed.Z > 0 then
- direction = -1
- end
- wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
- end
- -- Particles
- if hit and thruster.Velocity.magnitude >= 5 then
- wheelWeld.Part1.ParticleEmitter.Enabled = true
- else
- wheelWeld.Part1.ParticleEmitter.Enabled = false
- end
- end
- car.DriveSeat.Changed:connect(function(property)
- if property == "Occupant" then
- if car.DriveSeat.Occupant then
- local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
- if player then
- car.DriveSeat:SetNetworkOwner(player)
- local localCarScript = script.LocalCarScript:Clone()
- localCarScript.Parent = player.PlayerGui
- localCarScript.Car.Value = car
- localCarScript.Disabled = false
- end
- end
- end
- end)
- spawn(function()
- while true do
- game:GetService("RunService").Stepped:wait()
- for i, part in pairs(car:GetChildren()) do
- if part.Name == "Thruster" then
- UpdateThruster(part)
- end
- end
- if car.DriveSeat.Occupant then
- bodyPosition.MaxForce = Vector3.new()
- bodyGyro.MaxTorque = Vector3.new()
- else
- local hit, position, normal = Raycast.new(car.Chassis.Position, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
- if hit and hit.CanCollide then
- bodyPosition.MaxForce = Vector3.new(mass / 5, math.huge, mass / 5)
- bodyPosition.Position = (CFrame.new(position, position + normal) * CFrame.new(0, 0, -stats.Height.Value + 0.5)).p
- bodyGyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
- bodyGyro.CFrame = CFrame.new(position, position + normal) * CFrame.Angles(-math.pi/2, 0, 0)
- else
- bodyPosition.MaxForce = Vector3.new()
- bodyGyro.MaxTorque = Vector3.new()
- end
- end
- end
- end)
- end,o53)
- end))
- o54 = Create("LocalScript",{
- ["Name"] = "LocalCarScript",
- ["Parent"] = o53,
- ["Disabled"] = true,
- })
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- --Scripted by DermonDarble
- local userInputService = game:GetService("UserInputService")
- local camera = game.Workspace.CurrentCamera
- local player = game.Players.LocalPlayer
- local character = player.Character
- local humanoidRootPart = character.HumanoidRootPart
- local car = script:WaitForChild("Car").Value
- local stats = car:WaitForChild("Configurations")
- local Raycast = require(car.CarScript.RaycastModule)
- local cameraType = Enum.CameraType.Follow
- local movement = Vector2.new()
- local gamepadDeadzone = 0.14
- -- Input begin
- userInputService.InputBegan:connect(function(inputObject, gameProcessedEvent)
- if not gameProcessedEvent then
- if inputObject.KeyCode == Enum.KeyCode.W then
- movement = Vector2.new(movement.X, 1)
- elseif inputObject.KeyCode == Enum.KeyCode.A then
- movement = Vector2.new(-1, movement.Y)
- elseif inputObject.KeyCode == Enum.KeyCode.S then
- movement = Vector2.new(movement.X, -1)
- elseif inputObject.KeyCode == Enum.KeyCode.D then
- movement = Vector2.new(1, movement.Y)
- end
- end
- end)
- --Mobile support
- local mobileGui = script.MobileGui
- if userInputService.TouchEnabled then
- userInputService.ModalEnabled = true
- mobileGui.Parent = player.PlayerGui
- mobileGui.DrivePad.Up.MouseButton1Down:connect(function()
- movement = Vector2.new(movement.X, 1)
- end)
- mobileGui.DrivePad.Up.MouseButton1Up:connect(function()
- movement = Vector2.new(movement.X, 0)
- end)
- mobileGui.DrivePad.Down.MouseButton1Down:connect(function()
- movement = Vector2.new(movement.X, -1)
- end)
- mobileGui.DrivePad.Down.MouseButton1Up:connect(function()
- movement = Vector2.new(movement.X, 0)
- end)
- mobileGui.TurnPad.Left.MouseButton1Down:connect(function()
- movement = Vector2.new(-1, movement.Y)
- end)
- mobileGui.TurnPad.Left.MouseButton1Up:connect(function()
- movement = Vector2.new(0, movement.Y)
- end)
- mobileGui.TurnPad.Right.MouseButton1Down:connect(function()
- movement = Vector2.new(1, movement.Y)
- end)
- mobileGui.TurnPad.Right.MouseButton1Up:connect(function()
- movement = Vector2.new(0, movement.Y)
- end)
- mobileGui.ExitButton.Text = "Exit " .. car.Name
- mobileGui.ExitButton.MouseButton1Click:connect(function()
- character.Humanoid.Jump = true
- end)
- else
- mobileGui:Destroy()
- end
- --Gamepad support
- userInputService.InputChanged:connect(function(inputObject, gameProcessedEvent)
- --if not gameProcessedEvent then
- if inputObject.KeyCode == Enum.KeyCode.Thumbstick1 then
- if inputObject.Position.magnitude >= gamepadDeadzone then
- movement = Vector2.new(movement.X, inputObject.Position.Y)
- else
- movement = Vector2.new(movement.X, 0)
- end
- elseif inputObject.KeyCode == Enum.KeyCode.Thumbstick2 then
- if inputObject.Position.magnitude >= gamepadDeadzone then
- movement = Vector2.new(inputObject.Position.X, movement.Y)
- else
- movement = Vector2.new(0, movement.Y)
- end
- end
- --end
- end)
- -- Input end
- userInputService.InputEnded:connect(function(inputObject, gameProcessedEvent)
- if inputObject.KeyCode == Enum.KeyCode.W then
- if movement.Y == 1 then
- movement = Vector2.new(movement.X, 0)
- end
- elseif inputObject.KeyCode == Enum.KeyCode.A then
- if movement.X == -1 then
- movement = Vector2.new(0, movement.Y)
- end
- elseif inputObject.KeyCode == Enum.KeyCode.S then
- if movement.Y == -1 then
- movement = Vector2.new(movement.X, 0)
- end
- elseif inputObject.KeyCode == Enum.KeyCode.D then
- if movement.X == 1 then
- movement = Vector2.new(0, movement.Y)
- end
- end
- end)
- local force = 0
- local damping = 0
- local mass = 0
- for i, v in pairs(car:GetChildren()) do
- if v:IsA("BasePart") then
- mass = mass + (v:GetMass() * 196.2)
- end
- end
- force = mass * stats.Suspension.Value
- damping = force / stats.Bounce.Value
- local bodyVelocity = Instance.new("BodyVelocity", car.Chassis)
- bodyVelocity.velocity = Vector3.new(0, 0, 0)
- bodyVelocity.maxForce = Vector3.new(0, 0, 0)
- local bodyAngularVelocity = Instance.new("BodyAngularVelocity", car.Chassis)
- bodyAngularVelocity.angularvelocity = Vector3.new(0, 0, 0)
- bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
- local rotation = 0
- local function UpdateThruster(thruster)
- --Make sure we have a bodythrust to move the wheel
- local bodyThrust = thruster:FindFirstChild("BodyThrust")
- if not bodyThrust then
- bodyThrust = Instance.new("BodyThrust", thruster)
- end
- --Do some raycasting to get the height of the wheel
- local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
- local thrusterHeight = (position - thruster.Position).magnitude
- if hit and hit.CanCollide then
- --If we're on the ground, apply some forces to push the wheel up
- bodyThrust.force = Vector3.new(0, ((stats.Height.Value - thrusterHeight)^2) * (force / stats.Height.Value^2), 0)
- local thrusterDamping = thruster.CFrame:toObjectSpace(CFrame.new(thruster.Velocity + thruster.Position)).p * damping
- bodyThrust.force = bodyThrust.force - Vector3.new(0, thrusterDamping.Y, 0)
- else
- bodyThrust.force = Vector3.new(0, 0, 0)
- end
- --Wheels
- local wheelWeld = thruster:FindFirstChild("WheelWeld")
- if wheelWeld then
- wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
- -- Wheel turning
- local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
- local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
- if offset.Z < 0 then
- local direction = 1
- if speed.Z > 0 then
- direction = -1
- end
- wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
- end
- wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(rotation, 0, 0)
- end
- end
- --A simple function to check if the car is grounded
- local function IsGrounded()
- local hit, position = Raycast.new((car.Chassis.CFrame * CFrame.new(0, 0, (car.Chassis.Size.Z / 2) - 1)).p, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * (stats.Height.Value + 0.2))
- if hit and hit.CanCollide then
- return(true)
- end
- return(false)
- end
- local oldCameraType = camera.CameraType
- camera.CameraType = cameraType
- spawn(function()
- while character.Humanoid.SeatPart == car.DriveSeat do
- game:GetService("RunService").RenderStepped:wait()
- --Broken gyro input
- --[[if userInputService.GyroscopeEnabled then
- local inputObject, cframe = userInputService:GetDeviceRotation()
- local up = cframe:vectorToWorldSpace(Vector3.new(0, 1, 0))
- local angle = (1 - up.Y) * (math.abs(up.X) / up.X)
- movement = Vector2.new(angle, movement.Y)
- end]]
- if IsGrounded() then
- if movement.Y ~= 0 then
- local velocity = car.Chassis.CFrame.lookVector * movement.Y * stats.Speed.Value
- car.Chassis.Velocity = car.Chassis.Velocity:Lerp(velocity, 0.1)
- bodyVelocity.maxForce = Vector3.new(0, 0, 0)
- else
- bodyVelocity.maxForce = Vector3.new(mass / 2, mass / 4, mass / 2)
- end
- local rotVelocity = car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(movement.Y * stats.Speed.Value / 50, 0, -car.Chassis.RotVelocity.Y * 5 * movement.Y))
- local speed = -car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity).unit.Z
- rotation = rotation + math.rad((-stats.Speed.Value / 5) * movement.Y)
- if math.abs(speed) > 0.1 then
- rotVelocity = rotVelocity + car.Chassis.CFrame:vectorToWorldSpace((Vector3.new(0, -movement.X * speed * stats.TurnSpeed.Value, 0)))
- bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
- else
- bodyAngularVelocity.maxTorque = Vector3.new(mass / 4, mass / 2, mass / 4)
- end
- car.Chassis.RotVelocity = car.Chassis.RotVelocity:Lerp(rotVelocity, 0.1)
- --bodyVelocity.maxForce = Vector3.new(mass / 3, mass / 6, mass / 3)
- --bodyAngularVelocity.maxTorque = Vector3.new(mass / 6, mass / 3, mass / 6)
- else
- bodyVelocity.maxForce = Vector3.new(0, 0, 0)
- bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
- end
- for i, part in pairs(car:GetChildren()) do
- if part.Name == "Thruster" then
- UpdateThruster(part)
- end
- end
- end
- for i, v in pairs(car:GetChildren()) do
- if v:FindFirstChild("BodyThrust") then
- v.BodyThrust:Destroy()
- end
- end
- bodyVelocity:Destroy()
- bodyAngularVelocity:Destroy()
- camera.CameraType = oldCameraType
- userInputService.ModalEnabled = false
- if mobileGui then
- mobileGui:Destroy()
- end
- script:Destroy()
- end)
- end,o54)
- end))
- o55 = Create("ObjectValue",{
- ["Name"] = "Car",
- ["Parent"] = o54,
- })
- o56 = Create("ScreenGui",{
- ["Name"] = "MobileGui",
- ["Parent"] = o54,
- })
- o57 = Create("Frame",{
- ["Name"] = "DrivePad",
- ["Parent"] = o56,
- ["Transparency"] = 1,
- ["Position"] = UDim2.new(0,32,1,-156),
- ["Size"] = UDim2.new(0,64,0,128),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BackgroundTransparency"] = 1,
- })
- o58 = Create("ImageButton",{
- ["Name"] = "Up",
- ["Parent"] = o57,
- ["Transparency"] = 1,
- ["Size"] = UDim2.new(0,64,0,64),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BackgroundTransparency"] = 1,
- ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
- ["ImageRectOffset"] = Vector2.new(0, 256),
- ["ImageRectSize"] = Vector2.new(128, 128),
- })
- o59 = Create("ImageButton",{
- ["Name"] = "Down",
- ["Parent"] = o57,
- ["Transparency"] = 1,
- ["Position"] = UDim2.new(0,0,1,-64),
- ["Size"] = UDim2.new(0,64,0,64),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BackgroundTransparency"] = 1,
- ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
- ["ImageRectSize"] = Vector2.new(128, 128),
- })
- o60 = Create("Frame",{
- ["Name"] = "TurnPad",
- ["Parent"] = o56,
- ["Transparency"] = 1,
- ["Position"] = UDim2.new(1,-156,1,-96),
- ["Size"] = UDim2.new(0,128,0,64),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BackgroundTransparency"] = 1,
- })
- o61 = Create("ImageButton",{
- ["Name"] = "Left",
- ["Parent"] = o60,
- ["Transparency"] = 1,
- ["Size"] = UDim2.new(0,64,0,64),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BackgroundTransparency"] = 1,
- ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
- ["ImageRectOffset"] = Vector2.new(128, 128),
- ["ImageRectSize"] = Vector2.new(128, 128),
- })
- o62 = Create("ImageButton",{
- ["Name"] = "Right",
- ["Parent"] = o60,
- ["Transparency"] = 1,
- ["Position"] = UDim2.new(1,-64,0,0),
- ["Size"] = UDim2.new(0,64,0,64),
- ["BackgroundColor3"] = Color3.new(1, 1, 1),
- ["BackgroundTransparency"] = 1,
- ["Image"] = "rbxasset://textures/ui/DPadSheet.png",
- ["ImageRectOffset"] = Vector2.new(0, 128),
- ["ImageRectSize"] = Vector2.new(128, 128),
- })
- o63 = Create("TextButton",{
- ["Name"] = "ExitButton",
- ["Parent"] = o56,
- ["Transparency"] = 0.5,
- ["Position"] = UDim2.new(1,-128,0,0),
- ["Size"] = UDim2.new(0,128,0,32),
- ["Text"] = "Exit",
- ["BackgroundColor3"] = Color3.new(0.121569, 0.121569, 0.121569),
- ["BackgroundTransparency"] = 0.5,
- ["BorderSizePixel"] = 0,
- ["Font"] = Enum.Font.SourceSans,
- ["FontSize"] = Enum.FontSize.Size18,
- ["TextColor3"] = Color3.new(1, 1, 1),
- ["TextStrokeColor3"] = Color3.new(0.133333, 0.133333, 0.133333),
- ["TextStrokeTransparency"] = 0.75,
- })
- o66 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Top,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o67 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o68 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Back,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o69 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Bottom,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o70 = Create("ParticleEmitter",{
- ["Parent"] = mas,
- ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
- ["Rotation"] = NumberRange.new(0,360),
- ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
- ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
- ["Enabled"] = false,
- ["LightEmission"] = 0.20000000298023,
- ["Texture"] = "rbxassetid://287259619",
- ["Acceleration"] = Vector3.new(0, -5, 0),
- ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
- ["Rate"] = 50,
- ["RotSpeed"] = NumberRange.new(-200,200),
- ["Speed"] = NumberRange.new(0,0),
- ["VelocitySpread"] = 40,
- })
- o72 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Top,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o73 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o74 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Back,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o75 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Bottom,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o76 = Create("ParticleEmitter",{
- ["Parent"] = mas,
- ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
- ["Rotation"] = NumberRange.new(0,360),
- ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
- ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
- ["Enabled"] = false,
- ["LightEmission"] = 0.20000000298023,
- ["Texture"] = "rbxassetid://287259619",
- ["Acceleration"] = Vector3.new(0, -5, 0),
- ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
- ["Rate"] = 50,
- ["RotSpeed"] = NumberRange.new(-200,200),
- ["Speed"] = NumberRange.new(0,0),
- ["VelocitySpread"] = 40,
- })
- o78 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Top,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o79 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o80 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Back,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o81 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Bottom,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o82 = Create("ParticleEmitter",{
- ["Parent"] = mas,
- ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
- ["Rotation"] = NumberRange.new(0,360),
- ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
- ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
- ["Enabled"] = false,
- ["LightEmission"] = 0.20000000298023,
- ["Texture"] = "rbxassetid://287259619",
- ["Acceleration"] = Vector3.new(0, -5, 0),
- ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
- ["Rate"] = 50,
- ["RotSpeed"] = NumberRange.new(-200,200),
- ["Speed"] = NumberRange.new(0,0),
- ["VelocitySpread"] = 40,
- })
- o84 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Top,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o85 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o86 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Back,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o87 = Create("Texture",{
- ["Parent"] = mas,
- ["Transparency"] = 0.5,
- ["Texture"] = "http://www.roblox.com/asset/?id=259149256",
- ["Face"] = Enum.NormalId.Bottom,
- ["StudsPerTileU"] = 3,
- ["StudsPerTileV"] = 3,
- })
- o88 = Create("ParticleEmitter",{
- ["Parent"] = mas,
- ["Transparency"] = NumberSequence.new(1,0.80000001192093,0.66874998807907,0.67499995231628,0.8125,1),
- ["Rotation"] = NumberRange.new(0,360),
- ["Size"] = NumberSequence.new(0,0.53763449192047,0.80645143985748,0.91397821903229),
- ["Color"] = ColorSequence.new(Color3.new(0.121569, 0.121569, 0.121569),Color3.new(0.121569, 0.121569, 0.121569)),
- ["Enabled"] = false,
- ["LightEmission"] = 0.20000000298023,
- ["Texture"] = "rbxassetid://287259619",
- ["Acceleration"] = Vector3.new(0, -5, 0),
- ["Lifetime"] = NumberRange.new(0.80000001192093,1.2000000476837),
- ["Rate"] = 50,
- ["RotSpeed"] = NumberRange.new(-200,200),
- ["Speed"] = NumberRange.new(0,0),
- ["VelocitySpread"] = 40,
- })
- o89 = Create("Part",{
- ["Name"] = "Spikes",
- ["Parent"] = o1,
- ["Transparency"] = 1,
- ["Position"] = Vector3.new(-5.7395401, 3.24998713, 63.6900024),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-5.7395401, 3.24998713, 63.6900024, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(5.10000134, 3.60000324, 0.200000003),
- ["BottomSurface"] = Enum.SurfaceType.Weld,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- })
- o90 = Create("Script",{
- ["Name"] = "RunOver",
- ["Parent"] = o89,
- })
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function onTouched(hit)
- local human = hit.Parent:findFirstChild("Humanoid")
- if human and human:IsA("Humanoid") then
- human:TakeDamage(100)
- script.Parent.Parent.CarHP.Value=script.Parent.Parent.CarHP.Value-25
- end
- end
- script.Parent.Touched:connect(onTouched)
- end,o90)
- end))
- o91 = Create("ManualWeld",{
- ["Name"] = "Weld",
- ["Parent"] = o89,
- ["Part0"] = o89,
- ["Part1"] = o17,
- })
- o92 = Create("NumberValue",{
- ["Name"] = "CarHP",
- ["Parent"] = o1,
- ["Value"] = 5000,
- })
- o93 = Create("Script",{
- ["Parent"] = o92,
- })
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- while true do
- wait()
- if script.Parent.Value==0 or script.Parent.Value < 0 then
- local ex=Instance.new("Explosion")
- ex.Position=script.Parent.Parent.Chassis.Position
- ex.Parent=game.Workspace
- ex.BlastPressure=12500000
- ex.BlastRadius=10
- wait()
- game.Workspace.Jeep:Destroy()
- end
- print("(Jeep1)HP:"..script.Parent.Value)
- end
- end,o93)
- end))
- o94 = Create("Part",{
- ["Name"] = "Spikes",
- ["Parent"] = o1,
- ["Transparency"] = 1,
- ["Position"] = Vector3.new(-16.869545, 4.05998993, 63.6900024),
- ["Rotation"] = Vector3.new(0, 90, 0),
- ["CFrame"] = CFrame.new(-16.869545, 4.05998993, 63.6900024, 0, 0, 1, 0, 1, 0, -1, 0, 0),
- ["FormFactor"] = Enum.FormFactor.Custom,
- ["Size"] = Vector3.new(5.10000134, 3.60000324, 0.200000003),
- ["BottomSurface"] = Enum.SurfaceType.Weld,
- ["TopSurface"] = Enum.SurfaceType.Smooth,
- })
- o95 = Create("Script",{
- ["Name"] = "RunOver",
- ["Parent"] = o94,
- })
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- function onTouched(hit)
- local human = hit.Parent:findFirstChild("Humanoid")
- if human and human:IsA("Humanoid") then
- human:TakeDamage(100)
- script.Parent.Parent.CarHP.Value=script.Parent.Parent.CarHP.Value-25
- end
- end
- script.Parent.Touched:connect(onTouched)
- end,o95)
- end))
- o96 = Create("ManualWeld",{
- ["Name"] = "Weld",
- ["Parent"] = o94,
- ["Part0"] = o17,
- ["Part1"] = o94,
- })
- o97 = Create("Script",{
- ["Name"] = "CollisionMarker",
- ["Parent"] = o94,
- })
- table.insert(cors,coroutine.create(function()
- wait()
- runDummyScript(function()
- script.Parent.Touched:connect(function(h)
- wait()
- local can=true
- if not h.Parent:FindFirstChild("Humanoid") and can==true then
- can=false
- script.Parent.Parent.CarHP.Value=script.Parent.Parent.CarHP.Value-50
- wait(1)
- can=true
- end
- end)
- end,o97)
- end))
- mas.Parent = workspace
- mas:MakeJoints()
- local mas1 = mas:GetChildren()
- for i=1,#mas1 do
- mas1[i].Parent = workspace
- ypcall(function() mas1[i]:MakeJoints() end)
- end
- mas:Destroy()
- for i=1,#cors do
- coroutine.resume(cors[i])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement