subaru112g

exploding car script

Feb 14th, 2019
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.04 KB | None | 0 0
  1. local char = owner.Character
  2.  
  3. for i,v in pairs(char:GetChildren()) do
  4. if v.ClassName == "Hat" or v.ClassName == "Accessory" or v.ClassName == "ShirtGraphic" then
  5. v:Destroy()
  6. end
  7. if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  8. if not(v.Name == "Torso") then
  9. v.Transparency = 1
  10. end
  11. end
  12. end
  13.  
  14.  
  15. for i,v in pairs(char.Head:GetChildren()) do
  16. if v.ClassName == "Decal" then
  17. v.Transparency = 1
  18. end
  19. end
  20.  
  21. if char:FindFirstChild("Animate") then
  22. char.Animate:Destroy()
  23. end
  24. wait(0.1)
  25. local hum = char:FindFirstChildOfClass("Humanoid")
  26. local idleanim = Instance.new("Animation")
  27. idleanim.Name = "Roblox Idle Animation"
  28. idleanim.AnimationId = "http://www.roblox.com/asset/?id=182435998"
  29. local idleanimplay = hum:LoadAnimation(idleanim)
  30. idleanimplay:Play()
  31.  
  32. if hum then
  33. hum.Name = "CAR"
  34. hum.WalkSpeed = 50
  35. hum.MaxHealth = 9999999999999999
  36. hum.Health = 9999999999999999
  37. end
  38.  
  39. local m = Instance.new("SpecialMesh",char.Torso)
  40. m.Scale = Vector3.new(0.005, 0.005, 0.005)
  41. m.Offset = Vector3.new(0, -0.7, 0)
  42. m.MeshId = "rbxassetid://453074009"
  43. m.TextureId = "rbxassetid://453073781"
  44.  
  45. local plr = owner
  46.  
  47. local remote = Instance.new("RemoteEvent", char)
  48. remote.Name = "ReplicationEvent"
  49. local client = NLS([==[
  50. local mouse = game:GetService("Players").LocalPlayer:GetMouse()
  51. local remote = game:GetService("Players").LocalPlayer.Character:WaitForChild("ReplicationEvent")
  52. spawn(function()
  53. while game:GetService("RunService").Heartbeat:Wait() do
  54. remote = game:GetService("Players").LocalPlayer.Character:WaitForChild("ReplicationEvent")
  55. end
  56. end)
  57. game:GetService("UserInputService").InputBegan:Connect(function(input, isTyping)
  58. if isTyping == false and input.UserInputType == Enum.UserInputType.Keyboard then
  59. remote:FireServer(1, input.KeyCode)
  60. end
  61. end)
  62. mouse.Button1Down:Connect(function()
  63. remote:FireServer(2)
  64. end)
  65. remote.OnClientEvent:Connect(function()
  66. game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position, Vector3.new(mouse.Hit.Position.X, game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position.Y, mouse.Hit.Position.Z))
  67. end)
  68. ]==], char)
  69.  
  70. local RS = char.Torso["Right Shoulder"]
  71. local LS = char.Torso["Left Shoulder"]
  72. local RH = char.Torso["Right Hip"]
  73. local LH = char.Torso["Left Hip"]
  74. local rootj = char.HumanoidRootPart.RootJoint
  75. local throwbutton = false
  76. local throw = false
  77. local normalanim = true
  78. local attackd = false
  79. local animpose = "Idle"
  80. local timepos = 0
  81. local sine = 0
  82. local RSnor = RS.C0
  83. local LSnor = LS.C0
  84. local RHnor = RH.C0
  85. local LHnor = LH.C0
  86. local rootjnor = rootj.C0
  87.  
  88. ---------------------------------
  89. -------------Attacks-------------
  90. ---------------------------------
  91.  
  92. remote.OnServerEvent:Connect(function(Player, number, key)
  93. if number == 1 and plr.Name == Player.Name then
  94. if key == Enum.KeyCode.Z then
  95. attackd = true
  96. local bpart = Instance.new("Part", workspace)
  97. bpart.Size = Vector3.new(1, 1, 1)
  98. bpart.Locked = true
  99. bpart.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2)
  100. bpart.Velocity = Vector3.new(0, 1, 0)
  101. local update = 0.4
  102. while update > 0.1 do
  103. update = update * 0.9
  104. end
  105. for i = 1, 50 do
  106. local banpart = Instance.new("Part", workspace)
  107. banpart.Size = Vector3.new(1, 1, 1)
  108. banpart.CanCollide = true
  109. banpart.CFrame = bpart.CFrame
  110. local bCFrame = CFrame.new(0, 0, 0)
  111. local bVel = Vector3.new(0, 0, 0)
  112.  
  113. banpart.Size = Vector3.new(1, 1, 1)
  114. local weld = Instance.new("Weld", banpart)
  115. weld.Part0 = bpart
  116. weld.Part1 = banpart
  117. spawn(function()
  118. wait(1)
  119. banpart.Touched:Connect(function(hit)
  120. if hit.Parent and game:GetService("Players"):FindFirstChild(hit.Parent.Name) then
  121. local character = hit.Parent
  122. character:FindFirstChildOfClass("Humanoid").Jump = true
  123. end
  124. end)
  125. end)
  126. spawn(function()
  127. while wait() do
  128. if banpart.Parent ~= workspace then
  129. banpart = Instance.new("Part", workspace)
  130. banpart.Size = Vector3.new(1, 1, 1)
  131. banpart.CanCollide = true
  132. banpart.Size = Vector3.new(1, 1, 1)
  133. banpart.CFrame = bCFrame
  134. banpart.Velocity = bVel
  135. banpart.Touched:Connect(function(hit)
  136. if hit.Parent and game:GetService("Players"):FindFirstChild(hit.Parent.Name) then
  137. local character = hit.Parent
  138. character:FindFirstChildOfClass("Humanoid").Jump = true
  139. end
  140. end)
  141. else
  142. bCFrame = banpart.CFrame
  143. bVel = banpart.Velocity
  144. end
  145. end
  146. end)
  147. end
  148. char.Torso.Transparency = 1
  149. char.Torso.CFrame = char.Torso.CFrame + Vector3.new(0,30,0)
  150. local explosion = Instance.new("Explosion", bpart)
  151. explosion.Position = bpart.Position
  152. explosion.DestroyJointRadiusPercent = 20
  153. bpart.CanCollide = false
  154. attackd = false
  155.  
  156. end
  157.  
  158. elseif Player.Name == owner.Name then
  159.  
  160. end
  161. end)
  162.  
  163. while true do
  164. wait()
  165. for i,v in pairs(char:GetChildren()) do
  166. if v.ClassName == "Hat" or v.ClassName == "Accessory" then
  167. v:Destroy()
  168. end
  169. if v.ClassName == "Part" or v.ClassName == "MeshPart" then
  170. if not(v.Name == "Torso") then
  171. v.Transparency = 1
  172. end
  173. end
  174. end
  175. end
Add Comment
Please, Sign In to add comment