daily pastebin goal
3%
SHARE
TWEET

Roblox poop gun script with remote events

a guest Jul 22nd, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- made by ihab020920077
  2.  
  3. -- variables
  4.  
  5. local player = game.Players.LocalPlayer
  6. local mouse = player:GetMouse()
  7. local tool = Instance.new("Tool", player.Backpack)
  8. local handle = Instance.new("Part", tool)
  9. local shoot = Instance.new("RemoteEvent", tool)
  10. shoot.Name = "shoot"
  11. handle.Name = "Handle"
  12. handle.Size = Vector3.new(1, 1, 1)
  13. tool.Name = "Poop gun"
  14. equipped = false
  15.  
  16. -- Remote controllers
  17.  
  18. shoot.OnServerEvent:Connect(function()
  19.     if equipped == true then
  20.         local poop = Instance.new("Part", game.Workspace)
  21.         local poopsound = Instance.new("Sound", handle)
  22.         poopsound.SoundId = "rbxassetid://357613509"
  23.         poopsound.Playing = true
  24.         poop.BrickColor = BrickColor.new("Brown")
  25.         poop.Size = handle.Size
  26.         poop.Material = Enum.Material.Concrete
  27.         poop.Shape = "Ball"
  28.         poop.Position = mouse.Hit.Position
  29.         poop.Anchored = true
  30.         if mouse.Target.Parent:FindFirstChild("Humanoid") then
  31.             mouse.Target.Parent:FindFirstChild("Humanoid").Health = 0
  32.             wait(1)
  33.             poopsound:Destroy()
  34.             poop:Destroy()
  35.         end
  36.         if not mouse.Target.Parent:FindFirstChild("Humanoid") then
  37.             wait(1)
  38.             poopsound:Destroy()
  39.             poop:Destroy()
  40.         end
  41.     end
  42. end)
  43. -- events listeners
  44.  
  45.  
  46. mouse.Button1Down:connect(function()
  47.     shoot:FireServer()
  48. end)
  49.  
  50. tool.Equipped:connect(function()
  51.     equipped = true
  52. end)
  53.  
  54. tool.Unequipped:connect(function()
  55.     equipped = false
  56. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top