SHOW:
|
|
- or go back to the newest paste.
1 | if script.Parent.className~="HopperBin" then | |
2 | ma=Instance.new("HopperBin") | |
3 | ma.Name="Laser " | |
4 | --ma.Parent=game.Lighting | |
5 | - | ma.Parent=game.Players.YOURNAME.Backpack |
5 | + | ma.Parent=game.Players.SmokeDelsin.Backpack |
6 | script.Parent=ma | |
7 | end | |
8 | ||
9 | local Selected = false | |
10 | local Shoot = true | |
11 | function Click(Target) | |
12 | if(Target.Target.Parent:findFirstChild("Humanoid")~=nil)then | |
13 | Target.Target.Parent.Humanoid.Health = 0 | |
14 | end | |
15 | local P = Instance.new("Part") | |
16 | P.Name = "Laser" | |
17 | - | local Place0 = script.Parent.Parent.Parent.Character["Left Arm"].CFrame |
17 | + | |
18 | - | P.formFactor = 0 |
18 | + | |
19 | P.Parent = game.Workspace | |
20 | P.Color = Color3.new(0,0,1) | |
21 | P.Transparency = 0.5 | |
22 | P.Reflectance = 0.5 | |
23 | P.Anchored = true | |
24 | P.CanCollide = false | |
25 | local E = Instance.new("Explosion") | |
26 | E.Position = Target.Hit.p | |
27 | E.Parent = game.Workspace | |
28 | for i = 1,10 do | |
29 | P.Transparency = 0.5+(i*0.05) | |
30 | P.Reflectance = i*0.05 | |
31 | wait(0.1) | |
32 | end | |
33 | P:Rremove() | |
34 | end | |
35 | function Select(Mouse) | |
36 | local Arm = script.Parent.Parent.Parent.Character:findFirstChild("Left Arm") | |
37 | if(Arm==nil)then | |
38 | script.Parent:Remove() | |
39 | script:Remove() | |
40 | end | |
41 | Selected = true | |
42 | local Torso = script.Parent.Parent.Parent.Character:findFirstChild("Torso") | |
43 | if(Torso==nil)then | |
44 | script.Parent:Remove() | |
45 | script:Remove() | |
46 | end | |
47 | local ArmWeld = Torso:findFirstChild("Left Shoulder") | |
48 | if(ArmWeld~=nil)then | |
49 | ArmWeld.Parent = nil | |
50 | end | |
51 | Mouse.Button1Down:connect(function()Click(Mouse)end) | |
52 | Arm.Anchored = true | |
53 | while Selected do | |
54 | local Place0 = script.Parent.Parent.Parent.Character.Torso.CFrame | |
55 | Place0 = Place0 + ((Place0 * CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)).lookVector * 0.5) + (Place0 * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)).lookVector | |
56 | local Place1 = Place0 + ((Place0.p-Mouse.Hit.p).unit * -2) | |
57 | Arm.CFrame = CFrame.new((Place0.p + Place1.p)/2,Place0.p) * CFrame.fromEulerAnglesXYZ(-math.pi/2,0,0) | |
58 | wait() | |
59 | end | |
60 | Arm.Anchored = false | |
61 | if(ArmWeld~=nil)then | |
62 | ArmWeld.Parent = Torso | |
63 | end | |
64 | end | |
65 | function Deselect() | |
66 | Selected = false | |
67 | end | |
68 | script.Parent.Selected:connect(Select) | |
69 | script.Parent.Deselected:connect(Deselect) |