SHOW:
|
|
- or go back to the newest paste.
1 | player = game.Players.LocalPlayer | |
2 | repeat wait() until player.Character | |
3 | local tool = script.Parent | |
4 | local myhumanoid = player.Character.Humanoid | |
5 | - | local gaster = script.Parent.Handle |
5 | + | local gaster = script.Parent.handle |
6 | local aim = script.Parent.shoot | |
7 | ||
8 | ||
9 | enable = true | |
10 | cooldown = 1 | |
11 | ||
12 | function fire(pos) | |
13 | local beam = game.Lighting.beam:Clone() | |
14 | beam.Anchored = true | |
15 | beam.Parent = game.Workspace | |
16 | beam.CanCollide = false | |
17 | beam.CFrame = aim.CFrame | |
18 | ||
19 | local s = Instance.new("Sound") | |
20 | s.Name = "Blast" | |
21 | s.SoundId = "http://www.roblox.com/asset/?id=340722848" | |
22 | s.Volume = 1 | |
23 | s.Pitch = 3 | |
24 | s.Looped = false | |
25 | s.Parent = gaster | |
26 | s:Play() | |
27 | ||
28 | beam.Touched:connect(function(hit) | |
29 | if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Humanoid") ~= myhumanoid then | |
30 | hit.Parent.TakeDamage(1) | |
31 | wait(0.1) | |
32 | hit.Parent.TakeDamage(1) | |
33 | wait(0.1) | |
34 | hit.Parent.TakeDamage(1) | |
35 | wait(0.1) | |
36 | hit.Parent.TakeDamage(1) | |
37 | wait(0.1) | |
38 | hit.Parent.TakeDamage(1) | |
39 | wait(0.1) | |
40 | hit.Parent.TakeDamage(1) | |
41 | wait(0.1) | |
42 | hit.Parent.TakeDamage(1) | |
43 | fire:Destroy() | |
44 | end | |
45 | ||
46 | spawn(function() | |
47 | wait(2) | |
48 | fire:Destroy() | |
49 | end) | |
50 | ||
51 | tool.Equipped:connect(function(mouse) | |
52 | mouse.Button1Down:connect(function() | |
53 | if enable then | |
54 | enable = false | |
55 | fire(mouse.Hit.p) | |
56 | wait(0.2) | |
57 | enable = true | |
58 | end | |
59 | end) | |
60 | end) | |
61 | ||
62 | end) | |
63 | end |