Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local inuse = false
- local bubble
- local tool = script.Parent
- function pop()
- if bubble then
- bubble:Destroy()
- local sound = Instance.new("Sound")
- sound.Name = "InflateSound"
- sound.SoundId = "http://www.roblox.com/asset/?id=11895500"
- sound.Parent = tool.Handle
- sound.Stopped:Connect(function()
- sound:Destroy()
- end)
- sound:Play()
- end
- bubble = nil
- end
- tool.Activated:Connect(function()
- local head = tool.Parent:FindFirstChild( "Head" )
- if head then
- bubble = Instance.new( "Part" )
- bubble.Shape = "Ball"
- bubble.Color = Color3.fromRGB( 255, 0, 0 )
- bubble.Size = Vector3.new( 0, 0, 0 )
- local w = Instance.new( "Weld" )
- w.Part0 = head
- w.Part1 = bubble
- w.Parent = bubble
- bubble.CanCollide = false
- bubble.TopSurface = "Smooth"
- bubble.BottomSurface = "Smooth"
- bubble.RightSurface = "Smooth"
- bubble.LeftSurface = "Smooth"
- bubble.FrontSurface = "Smooth"
- bubble.BackSurface = "Smooth"
- bubble.Transparency = .5
- bubble.Parent = workspace
- local sound = Instance.new("Sound")
- sound.Name = "InflateSound"
- sound.SoundId = "http://www.roblox.com/asset/?id=11895499"
- sound.Parent = tool.Handle
- sound:Play()
- for i = 1, 60 do
- wait( .01 )
- if bubble then
- bubble.Size = bubble.Size + Vector3.new( .05, .05, .05 )
- bubble.CFrame = head.CFrame * CFrame.new( 0, -.25, -head.Size.Z/2 - bubble.Size.X/2 )
- local x = bubble.CFrame
- local w = Instance.new( "Weld" )
- w.Part0 = head
- w.Part1 = bubble
- w.C0 = w.Part0.CFrame:toObjectSpace( x )
- w.Parent = bubble
- else break
- end
- end
- sound:Stop()
- pop()
- end
- end)
- tool.Deactivated:Connect(function()
- pop()
- end)
- tool.Unequipped:Connect(function()
- pop()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement