Advertisement
KrYn0MoRe

car

Apr 26th, 2020 (edited)
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.24 KB | None | 0 0
  1. local spicyplayer = owner
  2. repeat wait()
  3.     spicyplayer.Character:FindFirstChildOfClass("Humanoid").Sit = true
  4.     wait(1)
  5. until spicyplayer.Character:FindFirstChildOfClass("Humanoid").Sit == true
  6. spicyplayer.Character:FindFirstChildOfClass("Humanoid").Animator:Destroy()
  7. repeat wait() until spicyplayer.Character:FindFirstChildOfClass("Humanoid").Sit == false
  8. local m = Instance.new("Sound", spicyplayer.Character.Head)
  9. m.Name = "INVISIBLECARBUFF"
  10. m.SoundId = "rbxassetid://2249103454" --2605084590
  11. m.Volume = 4
  12. m.Looped = true
  13. m:play()
  14. local hit = Instance.new("Sound", spicyplayer.Character.Head)
  15. hit.SoundId = 'rbxassetid://1897654568'
  16. hit.Volume = 1.5
  17. spicyplayer.Character.Humanoid.WalkSpeed = 200
  18.  
  19. --[[
  20. local exists1 = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Race Car kill')
  21. local exists2 = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Race Car')
  22. if not exists1 then
  23.     game:GetService("PhysicsService"):CreateCollisionGroup('Race Car kill')
  24. end
  25. if not exists2 then
  26.     game:GetService("PhysicsService"):CreateCollisionGroup('Race Car')
  27. end
  28. game:GetService("PhysicsService"):CollisionGroupSetCollidable('Race Car kill','Race Car',false)
  29.  
  30. for i,plr in pairs(game:GetService("Players"):GetPlayers()) do
  31.     local char = plr.Character
  32.     if char then
  33.         for i,v in pairs(char:GetChildren()) do
  34.             if v:IsA("BasePart") or v:IsA("UnionOperation") then
  35.                 game:GetService("PhysicsService"):SetPartCollisionGroup(v,'Race Car kill')
  36.             end
  37.         end
  38.     end
  39.     plr.CharacterAdded:Connect(function(_char)
  40.         for i,v in pairs(_char:GetChildren()) do
  41.             if v:IsA("BasePart") or v:IsA("UnionOperation") then
  42.                 game:GetService("PhysicsService"):SetPartCollisionGroup(v,'Race Car kill')
  43.             end
  44.         end
  45.     end)
  46. end
  47.  
  48. game:GetService("Players").PlayerAdded:Connect(function(plr)
  49.     local char = plr.Character
  50.     if char then
  51.         for i,v in pairs(char:GetChildren()) do
  52.             if v:IsA("BasePart") or v:IsA("UnionOperation") then
  53.                 game:GetService("PhysicsService"):SetPartCollisionGroup(v,'Race Car kill')
  54.             end
  55.         end
  56.     end
  57.     plr.CharacterAdded:Connect(function(_char)
  58.         for i,v in pairs(_char:GetChildren()) do
  59.             if v:IsA("BasePart") or v:IsA("UnionOperation") then
  60.                 game:GetService("PhysicsService"):SetPartCollisionGroup(v,'Race Car kill')
  61.             end
  62.         end
  63.     end)
  64. end)
  65. ]]
  66. spawn(function()
  67.     game:GetService("RunService").Heartbeat:Connect(function()
  68.         local char = spicyplayer.Character
  69.         local torso = char:FindFirstChild("Torso") or char:FindFirstChild("HumanoidRootPart")
  70.         local speed = 0.3
  71.         if torso then
  72.             speed = 0.3 + (torso.Velocity.magnitude/140)
  73.         end
  74.         if speed > 1 then
  75.             speed = 1
  76.         end
  77.         m.PlaybackSpeed = speed
  78.     end)
  79. end)
  80. function DReduce(p,dens)
  81.     for i,v in pairs(p:GetChildren())do
  82.         if v:IsA("BasePart") then
  83.             if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
  84.             v.CustomPhysicalProperties = PhysicalProperties.new(
  85.                 dens,
  86.                 v.CustomPhysicalProperties.Friction,
  87.                 v.CustomPhysicalProperties.Elasticity,
  88.                 v.CustomPhysicalProperties.FrictionWeight,
  89.                 v.CustomPhysicalProperties.ElasticityWeight
  90.             )
  91.         end
  92.         DReduce(v)
  93.     end
  94. end
  95. DReduce(spicyplayer.Character, 0.025)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement