Advertisement
alek_

Explode Yourself Roblox Script Client Sided 2020

Nov 7th, 2020
1,003
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. -- Press E to explode yourself. (CLIENT SIDED, PEOPLE CAN'T SEE YOU EXPLODE ONLY DIE)
  2. local Humanoid = script.Parent:FindFirstChild("Humanoid")
  3. local Torso
  4. local UserInputService = game:GetService("UserInputService")
  5. local Key = Enum.KeyCode.E
  6. local Cooldown = 7
  7. local CooldownWaited = 0
  8.  
  9. function RigTypeCheck()
  10.     if Humanoid.RigType == Enum.HumanoidRigType.R6 then
  11.         Torso = Humanoid.Parent:FindFirstChild("Torso")
  12.     elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
  13.         Torso = Humanoid.Parent:FindFirstChild("LowerTorso")
  14.     end
  15. end
  16.  
  17. RigTypeCheck()
  18.  
  19. UserInputService.InputBegan:Connect(function(Input)
  20.     if Input.KeyCode == Key then
  21.         if CooldownWaited <= 0 then
  22.             local Explosion = Instance.new("Explosion", workspace)
  23.             Explosion.Position = Torso.Position
  24.             wait()
  25.             Torso:Destroy()
  26.             CooldownWaited = Cooldown
  27.         elseif CooldownWaited > 0 then
  28.             repeat
  29.                 wait(1)
  30.                 CooldownWaited = CooldownWaited - 1
  31.             until CooldownWaited <= 0
  32.         end
  33.     end
  34. end)
  35. -- Ubicast
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement