Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jool = Instance.new("Tool", game.Workspace)
- wait(1)
- jool.Parent = game.Workspace.firemomo45
- jool.Name = "Dr Hax's Computer"
- Randle = Instance.new("Part",jool)
- Randle.Name = "Handle"
- Randle.Anchored = true
- Voing = Instance.new("Sound",Randle)
- Voing.Name = "Boing"
- Voing.MaxDistance = 10000
- Voing.SoundId = "rbxassetid://142082167"
- Lesh = Instance.new("SpecialMesh",Randle)
- Lesh.MeshId = "http://www.roblox.com/asset/?id=11641931"
- Lesh.Scale = Vector3.new(2.2,2.2,2.2)
- Lesh.TextureId = "http://www.roblox.com/asset/?id=11641912"
- Bart = Instance.new("Part", jool)
- Bart.Anchored = true
- Bart.CanCollide = false
- Bart.Size = Vector3.new(.6,1.8,2)
- Haax = Instance.new("Sound", Bart)
- Haax.SoundId = "rbxassetid://143852292"
- Recal = Instance.new("Decal",Bart)
- Recal.Texture = "http://www.roblox.com/asset/?id=84645430"
- Recal.Face = 0
- --Here comes the hard fucking part
- wait(1)
- local Tool = jool
- local Ball = Randle
- head = Randle
- function onEquip()
- weld = Instance.new("Weld", Bart)
- weld.Part0 = head
- weld.C0 = head.CFrame:inverse()
- weld.Part1 = Bart
- weld.C1 = Bart.CFrame:inverse()
- Haax:Play()
- wait(1)
- Bart.Anchored = false
- head.Anchored = false
- end
- function Removed()
- Bart.Anchored = true
- head.Anchored = true
- end
- jool.Equipped:connect(onEquip)
- jool.Unequipped:connect(Removed)
- function fire(direction)
- Tool.Handle.Boing:Play()
- local vCharacter = jool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local missile = Instance.new("Part")
- local spawnPos = vCharacter.PrimaryPart.Position
- spawnPos = spawnPos + (direction * 5)
- missile.Position = spawnPos
- missile.Size = Vector3.new(2,2,2)
- missile.Velocity = direction * 200
- missile.BrickColor = BrickColor.random()
- missile.Shape = 0
- missile.BottomSurface = 0
- missile.TopSurface = 0
- missile.Name = "Cannon Shot"
- missile.Elasticity = 1
- missile.Reflectance = .2
- missile.Friction = 0
- Voing:clone().Parent = missile
- Lesh:clone().Parent = missile
- local Ball = missile
- local damage = 25
- local r = game:service("RunService")
- local debris = game:GetService("Debris")
- local last_sound_time = r.Stepped:wait()
- function onTouched(hit)
- if hit.Parent == nil then return end
- local now = r.Stepped:wait()
- if (now - last_sound_time > .1) then
- missile.Boing:play()
- last_sound_time = now
- else
- return
- end
- local humanoid = hit.Parent:FindFirstChild("Humanoid")
- if humanoid ~=nil then
- tagHumanoid(humanoid)
- humanoid:TakeDamage(damage)
- local b = Instance.new("BillboardGui",hit.Parent.Torso)
- local img = Instance.new("ImageLabel",b)
- img.Image = "rbxassetid://109174960"
- img.BackgroundTransparency = 1
- b.Size = UDim2.new(8, 0, 4, 0)
- img.Size = UDim2.new(1, 10, 1, 10)
- b.Enabled = true
- img.Position = UDim2.new(0,0,-1,1)
- wait(0.5)
- if hit.Parent:FindFirstChild("Humanoid") then
- local s = Instance.new("Sound",hit.Parent.Torso)
- s.SoundId = "http://www.roblox.com/asset/?id=147722910"
- s.PlayOnRemove = true
- wait(0.5)
- if hit ~= nil then
- hit.Parent.Torso:Destroy()
- hit.Parent:Destroy()
- end
- end
- if connection then connection:disconnect() end
- else
- damage = damage / 2
- if damage < 2 then
- if connection then connection:disconnect() end
- end
- end
- end
- function tagHumanoid(humanoid)
- local tag = missile:findFirstChild("creator")
- if tag ~= nil then
- local new_tag = tag:clone()
- new_tag.Parent = humanoid
- debris:AddItem(new_tag, 2)
- end
- end
- connection = missile.Touched:connect(onTouched)
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = missile
- missile.Parent = game.Workspace
- end
- jool.Enabled = true
- function onActivated()
- if not jool.Enabled then
- return
- end
- jool.Enabled = false
- local character = jool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- local targetPos = humanoid.TargetPoint
- local lookAt = (targetPos - character.Head.Position).unit
- fire(lookAt)
- wait(0.5)
- jool.Enabled = true
- end
- Tool.Activated:connect(onActivated)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement