Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. local inuse = false
  2.  
  3. local bubble
  4. local tool = script.Parent
  5.  
  6. function pop()
  7. if bubble then
  8. bubble:Destroy()
  9. local sound = Instance.new("Sound")
  10. sound.Name = "InflateSound"
  11. sound.SoundId = "http://www.roblox.com/asset/?id=11895500"
  12. sound.Parent = tool.Handle
  13. sound.Stopped:Connect(function()
  14. sound:Destroy()
  15. end)
  16. sound:Play()
  17. end
  18. bubble = nil
  19. end
  20.  
  21. tool.Activated:Connect(function()
  22. local head = tool.Parent:FindFirstChild( "Head" )
  23. if head then
  24. bubble = Instance.new( "Part" )
  25. bubble.Shape = "Ball"
  26. bubble.Color = Color3.fromRGB( 255, 0, 0 )
  27. bubble.Size = Vector3.new( 0, 0, 0 )
  28. local w = Instance.new( "Weld" )
  29. w.Part0 = head
  30. w.Part1 = bubble
  31. w.Parent = bubble
  32. bubble.CanCollide = false
  33. bubble.TopSurface = "Smooth"
  34. bubble.BottomSurface = "Smooth"
  35. bubble.RightSurface = "Smooth"
  36. bubble.LeftSurface = "Smooth"
  37. bubble.FrontSurface = "Smooth"
  38. bubble.BackSurface = "Smooth"
  39. bubble.Transparency = .5
  40. bubble.Parent = workspace
  41. local sound = Instance.new("Sound")
  42. sound.Name = "InflateSound"
  43. sound.SoundId = "http://www.roblox.com/asset/?id=11895499"
  44. sound.Parent = tool.Handle
  45. sound:Play()
  46. for i = 1, 60 do
  47. wait( .01 )
  48. if bubble then
  49. bubble.Size = bubble.Size + Vector3.new( .05, .05, .05 )
  50. bubble.CFrame = head.CFrame * CFrame.new( 0, -.25, -head.Size.Z/2 - bubble.Size.X/2 )
  51. local x = bubble.CFrame
  52. local w = Instance.new( "Weld" )
  53. w.Part0 = head
  54. w.Part1 = bubble
  55. w.C0 = w.Part0.CFrame:toObjectSpace( x )
  56. w.Parent = bubble
  57. else break
  58. end
  59. end
  60. sound:Stop()
  61. pop()
  62. end
  63. end)
  64.  
  65. tool.Deactivated:Connect(function()
  66. pop()
  67. end)
  68.  
  69. tool.Unequipped:Connect(function()
  70. pop()
  71. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement