Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- seat = Instance.new("VehicleSeat", script)
- seat.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-5,0,10)
- stand = Instance.new("Part", script)
- stand.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,-2.5,10)
- stand.Size = Vector3.new(15,5,10)
- stand.Anchored = true
- stand.Material = "SmoothPlastic"
- seat.Material = "SmoothPlastic"
- seat2 = Instance.new("VehicleSeat", script)
- seat2.Material = "SmoothPlastic"
- seat.Color = Color3.fromRGB(0,0,0)
- seat2.Color = Color3.fromRGB(0,0,0)
- seat2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(5,0,10)
- paddle = Instance.new("Part", script)
- paddle.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-15,10,5)
- paddle.Color = Color3.fromRGB(255,255,255)
- paddle.Size = Vector3.new(1,7.5,0.125)
- paddle.CanCollide = false
- paddle3 = Instance.new("Part", script)
- paddle3.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,16,5)
- oldcf = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,16,5)
- paddle3.Color = Color3.fromRGB(255,255,255)
- paddle3.Size = Vector3.new(1,1,0.125)
- bounce = Instance.new("Sound",paddle3)
- bounce.SoundId = "rbxassetid://877986348"
- bounce.Volume = 7.5
- paddle2 = Instance.new("Part", script)
- paddle2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(15,10,5)
- paddle2.Color = Color3.fromRGB(255,255,255)
- paddle2.Size = Vector3.new(1,7.5,0.125)
- paddle2.CanCollide = false
- wall = Instance.new("Part", script)
- wall.CanTouch = false
- wall.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,16,4.875)
- wall.Size = Vector3.new(40,20,0.125)
- wall.Anchored = true
- wall.Color = Color3.fromRGB(0,0,0)
- wall4 = Instance.new("Part", script)
- wall4.CanTouch = false
- wall4.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,16,5.25)
- wall4.Size = Vector3.new(40,20,0.05)
- wall4.Anchored = true
- wall4.Transparency = 0.75
- wall7 = Instance.new("Part", script)
- wall7.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-15,30,4.875)
- wall7.Size = Vector3.new(5,5,0.05)
- wall7.Anchored = true
- wall8 = Instance.new("Part", script)
- wall8.CanTouch = false
- wall8.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(15,30,4.875)
- wall8.Size = Vector3.new(5,5,0.125)
- wall8.Anchored = true
- local screengui3 = Instance.new("SurfaceGui", wall7)
- screengui3.Name = "Hud3"
- screengui3.Face = Enum.NormalId.Back
- tl1 = Instance.new("TextBox", screengui3)
- tl1.Size = UDim2.new(1, 0, 1, 0)
- tl1.BackgroundTransparency = 1
- tl1.Text = "Score 0"
- screengui3.AlwaysOnTop = true
- local screengui4 = Instance.new("SurfaceGui", wall8)
- screengui4.Name = "Hud3"
- screengui4.Face = Enum.NormalId.Back
- tl2 = Instance.new("TextBox", screengui4)
- tl2.Size = UDim2.new(1, 0, 1, 0)
- tl2.BackgroundTransparency = 1
- tl2.Text = "Score 0"
- screengui3.AlwaysOnTop = true
- tl2.TextSize = 200
- tl1.TextSize = 200
- tl1.TextColor3 = Color3.fromRGB(255,255,255)
- tl2.TextColor3 = Color3.fromRGB(255,255,255)
- wall2 = Instance.new("Part", script)
- wall2.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,6,5)
- wall2.Size = Vector3.new(40,0.525,0.5)
- wall2.Anchored = true
- wall2.Color = Color3.fromRGB(0,0,0)
- wall2.Name = "Limits"
- wall5 = Instance.new("Part", script)
- wall5.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(20,16,5)
- wall5.Size = Vector3.new(0.525,20,0.5)
- wall5.Anchored = true
- wall5.Color = Color3.fromRGB(0,0,0)
- wall5.Name = "Limits3"
- wall6 = Instance.new("Part", script)
- wall6.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(-20,16,5)
- wall6.Size = Vector3.new(0.525,20,0.5)
- wall6.Anchored = true
- wall6.Color = Color3.fromRGB(0,0,0)
- wall6.Name = "Limits4"
- wall3 = Instance.new("Part", script)
- wall3.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,26,5)
- wall3.Size = Vector3.new(40,0.525,0.5)
- wall3.Anchored = true
- wall3.Color = Color3.fromRGB(0,0,0)
- wall3.Name = "Limits2"
- seat.Anchored = true
- seat2.Anchored = true
- speed = 25
- bp = Instance.new("BodyPosition",paddle)
- bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bp.P = 1000000
- bp.Position = paddle.Position
- bg = Instance.new("BodyGyro",paddle)
- bg.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- bp3 = Instance.new("BodyPosition",paddle2)
- bp3.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bp3.P = 1000000
- bp3.Position = paddle2.Position
- bg3 = Instance.new("BodyGyro",paddle2)
- bg3.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- bp2 = Instance.new("BodyVelocity",paddle3)
- bp2.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bp2.Velocity = Vector3.new(0,0,0)
- bg2 = Instance.new("BodyGyro",paddle3)
- bg2.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
- bg2.P = 100000000
- bg3.P = 100000000
- bg.P = 100000000
- for i,v in pairs(script:GetDescendants()) do
- if v:IsA("Part") then
- v.Locked = true
- end
- end
- bg2.CFrame = paddle3.CFrame
- bg3.CFrame = paddle2.CFrame
- bg.CFrame = paddle.CFrame
- on = false
- on2 = false
- start = false
- local function carMove(property)
- pcall(function()
- if seat.Occupant ~= nil then
- paddle:SetNetworkOwner(game:GetService("Players"):GetPlayerFromCharacter(seat.Occupant.Parent))
- end
- end)
- if property == "Throttle" then
- if seat.Throttle ~= 0 then
- on = true
- elseif seat.Throttle == 0 then
- on = false
- end
- elseif property == "Steer" then
- if seat.Steer == -1 then
- if not start then
- bp2.Velocity = paddle3.CFrame.rightVector * 10
- start = true
- elseif start then
- bp2.Velocity = Vector3.new(0,0,0)
- paddle3.CFrame = oldcf
- start = false
- end
- elseif seat.Steer == 1 then
- paddle3.CFrame = oldcf
- end
- end
- end
- local function carMove2(property)
- pcall(function()
- if seat2.Occupant ~= nil then
- paddle2:SetNetworkOwner(game:GetService("Players"):GetPlayerFromCharacter(seat.Occupant.Parent))
- end
- end)
- if property == "Throttle" then
- if seat2.Throttle ~= 0 then
- on2 = true
- elseif seat2.Throttle == 0 then
- on2 = false
- end
- end
- end
- seat.Changed:Connect(carMove)
- seat2.Changed:Connect(carMove2)
- count = 0
- count2 = 0
- wait(0.1)
- local density = 10
- local friction = 0
- local elasticity = 0
- local frictionWeight = 100000000000
- local elasticityWeight = 0
- local physProperties = PhysicalProperties.new(density, friction, elasticity, frictionWeight, elasticityWeight)
- paddle.CustomPhysicalProperties = physProperties
- paddle2.CustomPhysicalProperties = physProperties
- paddle3.CustomPhysicalProperties = physProperties
- seat:Sit(owner.Character.Humanoid)
- currentz = paddle.Position.z
- currentz2 = paddle2.Position.z
- paddle3.Touched:Connect(function(hit)
- coroutine.wrap(function()
- if hit.Name ~= "Limits3" then
- if hit.Name ~= "Limits4" then
- if hit.Name ~= "Limits" then
- if hit.Name ~= "Limits2" then
- bounce.PlaybackSpeed = math.random(0.85,1.25)
- bounce:Play()
- bp2.Velocity = CFrame.new(paddle3.Position,hit.Position).lookVector * -10
- elseif hit.Name == "Limits2" then
- bounce.PlaybackSpeed = math.random(0.85,1.25)
- bounce:Play()
- bp2.Velocity = bp2.Velocity + Vector3.new(0,-10,0)
- end
- elseif hit.Name == "Limits" then
- bounce.PlaybackSpeed = math.random(0.85,1.25)
- bounce:Play()
- bp2.Velocity = bp2.Velocity + Vector3.new(0,10,0)
- end
- elseif hit.Name == "Limits4" then
- count = count + 1
- paddle3.CFrame = oldcf
- tl2.Text = "Score "..count
- end
- elseif hit.Name == "Limits3" then
- count2 = count2 + 1
- paddle3.CFrame = oldcf
- tl1.Text = "Score "..count2
- end
- end)()
- end)
- while true do
- task.wait()
- if on then
- bp.Position = Vector3.new(paddle.Position.x,math.clamp(paddle.Position.y,14,24),currentz) + Vector3.new(0,seat.Throttle * 1.5,0)
- end
- if on2 then
- bp3.Position = Vector3.new(paddle2.Position.x,math.clamp(paddle2.Position.y,14,24),currentz2) + Vector3.new(0,seat2.Throttle * 1.5,0)
- end
- end
Add Comment
Please, Sign In to add comment