SHOW:
|
|
- or go back to the newest paste.
1 | - | NLS([[ -- thank rufus for head look and stuf |
1 | + | |
2 | - | owner = game:GetService("Players").LocalPlayer |
2 | + | NLS([[ |
3 | - | owner.Character:WaitForChild("Head") |
3 | + | |
4 | ||
5 | - | local remote = owner.Character:WaitForChild("lookremote") |
5 | + | |
6 | - | local remote2 = owner.Character:WaitForChild("crouch remote") |
6 | + | |
7 | - | local part = Instance.new("Part", owner.Character.Head) |
7 | + | E:FireServer(mouse.Hit.Position) |
8 | - | part.Size = Vector3.new(0.1,0.1,0.1) |
8 | + | |
9 | - | part.Transparency = 1 |
9 | + | |
10 | - | part.CanCollide = false |
10 | + | |
11 | - | part.Name = "camera" |
11 | + | |
12 | - | part:BreakJoints() |
12 | + | |
13 | - | local weld = Instance.new("Weld", part) |
13 | + | |
14 | - | weld.Part0 = owner.Character.Head |
14 | + | |
15 | - | weld.Part1 = part |
15 | + | |
16 | - | weld.C0 = CFrame.new(0,0,-1) |
16 | + | |
17 | - | count = 0 |
17 | + | |
18 | - | function crouchinglol(key) |
18 | + | |
19 | - | key = key:lower() |
19 | + | |
20 | - | if key:byte() == 48 then |
20 | + | |
21 | - | count = count + 1 |
21 | + | |
22 | - | if count == 1 then |
22 | + | |
23 | - | owner.Character:findFirstChildOfClass("Humanoid").WalkSpeed = 8 |
23 | + | |
24 | - | remote2:FireServer("Crouching") |
24 | + | |
25 | - | elseif count == 2 then |
25 | + | |
26 | - | owner.Character:findFirstChildOfClass("Humanoid").WalkSpeed = 16 |
26 | + | |
27 | - | remote2:FireServer("NotCrouching") |
27 | + | |
28 | - | wait() |
28 | + | |
29 | - | count = 0 |
29 | + | |
30 | limbcollider.Shape = "Cylinder" | |
31 | - | end |
31 | + | |
32 | limbcollider.Name = "LimbCollider" | |
33 | - | mouse.KeyDown:connect(crouchinglol) |
33 | + | |
34 | limbcolliderweld.Part0 = PC.Character:findFirstChild("Right Arm") | |
35 | limbcolliderweld.Part1 = limbcollider | |
36 | limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0) | |
37 | - | E:FireServer("s") |
37 | + | |
38 | limbcollider2.Size = Vector3.new(1.4,1,1) | |
39 | limbcollider2.Shape = "Cylinder" | |
40 | - | while game:GetService("RunService").RenderStepped:wait() do |
40 | + | |
41 | - | remote:FireServer(mouse.Hit.p, mouse.Origin.p, workspace.CurrentCamera.CFrame) |
41 | + | |
42 | - | if (workspace.CurrentCamera.CFrame.p - part.Position).magnitude <= 1.7 then |
42 | + | |
43 | - | game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position,Vector3.new(mouse.Hit.p.x,game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position.y,mouse.Hit.p.z)) |
43 | + | |
44 | - | workspace.CurrentCamera.FieldOfView = 100 |
44 | + | |
45 | - | for i,v in pairs(owner.Character:GetChildren()) do |
45 | + | |
46 | - | if v.ClassName == "Part" or v.ClassName == "MeshPart" and v.Name ~= "Head" then |
46 | + | |
47 | - | v.LocalTransparencyModifier = 0 |
47 | + | |
48 | - | end |
48 | + | |
49 | - | if v.ClassName == "Accessory" then |
49 | + | |
50 | - | v.Handle.Transparency = 1 |
50 | + | |
51 | - | end |
51 | + | |
52 | - | end |
52 | + | |
53 | - | if owner.Character.Head:findFirstChildOfClass("Decal") then |
53 | + | |
54 | - | owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 1 |
54 | + | |
55 | - | end |
55 | + | |
56 | - | owner.Character.Head.Transparency = 1 |
56 | + | |
57 | - | workspace.CurrentCamera.CameraSubject = part |
57 | + | |
58 | - | else |
58 | + | |
59 | - | for i,v in pairs(owner.Character:GetChildren()) do |
59 | + | |
60 | - | if v.ClassName == "Accessory" then |
60 | + | |
61 | - | v.Handle.Transparency = 0 |
61 | + | |
62 | - | end |
62 | + | |
63 | - | end |
63 | + | |
64 | - | workspace.CurrentCamera.FieldOfView = 70 |
64 | + | |
65 | - | owner.Character.Head.Transparency = 0 |
65 | + | |
66 | - | if owner.Character.Head:findFirstChildOfClass("Decal") then |
66 | + | |
67 | - | owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 0 |
67 | + | |
68 | - | end |
68 | + | |
69 | - | workspace.CurrentCamera.CameraSubject = owner.Character |
69 | + | |
70 | - | end |
70 | + | |
71 | local Socket = Instance.new("BallSocketConstraint") | |
72 | local a1 = Instance.new("Attachment") | |
73 | local a2 = Instance.new("Attachment") | |
74 | a1.Parent = v.Part0 | |
75 | a2.Parent = v.Part1 | |
76 | Socket.Parent = v.Parent | |
77 | Socket.Attachment0 = a1 | |
78 | Socket.Attachment1 = a2 | |
79 | a1.CFrame = v.C0 | |
80 | a2.CFrame = v.C1 | |
81 | Socket.LimitsEnabled = true | |
82 | Socket.TwistLimitsEnabled = true | |
83 | v.Enabled = false | |
84 | debris:AddItem(a1, 3) | |
85 | debris:AddItem(a2, 3) | |
86 | debris:AddItem(Socket, 3) | |
87 | end | |
88 | end | |
89 | end | |
90 | end | |
91 | end | |
92 | end | |
93 | out = false | |
94 | Bullet = Instance.new("Part", owner.Character) | |
95 | Bullet.Position = Vector3.new(1000000,1000000,1000000) | |
96 | Bullet.Anchored = true | |
97 | Bullet.CanCollide = false | |
98 | Bullet2 = Instance.new("Part", owner.Character) | |
99 | Bullet2.Position = Vector3.new(1000000,1000000,1000000) | |
100 | Bullet2.Anchored = true | |
101 | Bullet2.CanCollide = false | |
102 | Bullet2.Shape = Enum.PartType.Ball | |
103 | Tool = Instance.new("Tool") | |
104 | Part = Instance.new("Part") | |
105 | Part.Name = "Handle" | |
106 | Part.Parent = Tool | |
107 | Part.Size = Vector3.new(1,1,3.75) | |
108 | Part.Color = Color3.fromRGB(25, 25, 25) | |
109 | Part.Massless = true | |
110 | Part2 = Instance.new("Part") | |
111 | Part2.Parent = Part | |
112 | Part2.Size = Vector3.new(0.85,0.85,0.85) | |
113 | Part2.Color = Color3.fromRGB(91, 91, 91) | |
114 | Part2.Massless = true | |
115 | Part2.CanCollide = false | |
116 | Tool.GripPos = Vector3.new(0,-1,0.8125) | |
117 | Tool.Parent = owner.Character | |
118 | local E = Instance.new("RemoteEvent", owner.Character) | |
119 | E.Name = "The" | |
120 | Bullet.Color = Color3.fromRGB(184, 65, 65) | |
121 | Bullet.Material = Enum.Material.Neon | |
122 | Bullet2.Color = Color3.fromRGB(184, 65, 65) | |
123 | Bullet2.Material = Enum.Material.Neon | |
124 | ShootWeld = Instance.new("Weld", Part) | |
125 | ShootWeld.Part0 = Part2 | |
126 | ShootWeld.Part1 = Part | |
127 | ShootWeld.C0 = CFrame.new(0,0,1.475) | |
128 | Part.Material = Enum.Material.SmoothPlastic | |
129 | Part2.Material = Enum.Material.SmoothPlastic | |
130 | local Pow = Instance.new("Sound", owner.Character.Head) | |
131 | Pow.SoundId = "rbxassetid://130113322" | |
132 | Pow.Volume = 1 | |
133 | Pow.PlaybackSpeed = 0.85 | |
134 | local fade = Instance.new("Sound", owner.Character.Head) | |
135 | fade.SoundId = "rbxassetid://130113370" | |
136 | fade.Volume = 1 | |
137 | fade.PlaybackSpeed = 0.85 | |
138 | Tool.Equipped:Connect(function() | |
139 | out = true | |
140 | end) | |
141 | Tool.Unequipped:Connect(function() | |
142 | out = false | |
143 | end) | |
144 | E.OnServerEvent:Connect(function(plr, position) | |
145 | if out then | |
146 | Pow:Play() | |
147 | local origin = Part2.Position | |
148 | local direction = (position - origin).Unit*300 | |
149 | local params = RaycastParams.new() | |
150 | params.FilterDescendantsInstances = {owner.Character} | |
151 | params.FilterType = Enum.RaycastFilterType.Blacklist | |
152 | local result = game.Workspace:Raycast(origin, direction, params) | |
153 | ||
154 | local intersection = result and result.Position or origin + direction | |
155 | local distance = (origin - intersection).Magnitude | |
156 | local bullet_clone = Bullet:Clone() | |
157 | bullet_clone.Size = Vector3.new(0.75, 0.75, distance * 0.95) | |
158 | bullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2 * 0.95) | |
159 | bullet_clone.Parent = owner.Character | |
160 | local bullet_clone2 = Bullet2:Clone() | |
161 | bullet_clone2.Size = Vector3.new(2.75, 2.75, 2.75) | |
162 | - | Part.Name = "Gun" |
162 | + | bullet_clone2.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance) |
163 | - | Part.Parent = owner.Character |
163 | + | bullet_clone2.Parent = owner.Character |
164 | - | Part.Size = Vector3.new(0.47466666666,1.67733333333,3.77766666667) |
164 | + | |
165 | - | Part.CanCollide = false |
165 | + | |
166 | - | Weld4 = Instance.new("Weld", owner.Character) |
166 | + | |
167 | - | Weld4.Part0 = Part |
167 | + | |
168 | - | Weld4.Part1 = owner.Character["Right Arm"] |
168 | + | |
169 | - | Weld4.C0 = CFrame.new(0,0,2.63883333334) * CFrame.Angles(math.rad(90),0,0) |
169 | + | |
170 | velocity.Velocity = bullet_clone.CFrame.lookVector * 50 | |
171 | velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge) | |
172 | - | Bullet.BrickColor = BrickColor.new("Bright yellow") |
172 | + | debris:AddItem(velocity,0.125) |
173 | - | Mesh = Instance.new("SpecialMesh") |
173 | + | |
174 | - | Mesh.Parent = Part |
174 | + | |
175 | - | Mesh.MeshId = "http://www.roblox.com/asset/?id=553398821" |
175 | + | |
176 | - | Mesh.TextureId = "http://www.roblox.com/asset/?id=553398915" |
176 | + | |
177 | - | Mesh.Scale = Vector3.new(0.333333333333, 0.333333333333, 0.333333333333) |
177 | + | |
178 | humanoid.Health = humanoid.Health - 45 | |
179 | - | Pow.SoundId = "rbxassetid://3810328903" |
179 | + | |
180 | - | Pow.Volume = 2 |
180 | + | |
181 | end | |
182 | - | E.OnServerEvent:Connect(function() |
182 | + | |
183 | local tweenService = game:GetService("TweenService") | |
184 | - | local origin = Part.Position |
184 | + | |
185 | - | local position = Part.CFrame.lookVector * 300 |
185 | + | local object = bullet_clone |
186 | local tweenInfo = TweenInfo.new(timeToFade) | |
187 | - | local result = game.Workspace:Raycast(origin, direction) |
187 | + | |
188 | goal.Transparency = 1 | |
189 | ||
190 | - | local distance = (origin - intersection).Magnitude + 2.5 |
190 | + | |
191 | local object2 = bullet_clone2 | |
192 | local tween2 = tweenService:Create(object2, tweenInfo, goal) | |
193 | - | bullet_clone.Size = Vector3.new(0.1, 0.1, distance) |
193 | + | |
194 | - | bullet_clone.CFrame = CFrame.new(origin, intersection)*CFrame.new(0, 0, -distance/2) |
194 | + | |
195 | - | bullet_clone.Parent = game.Workspace |
195 | + | local object3 = bullet_clone |
196 | local tweenInfo2 = TweenInfo.new(timeToFade2) | |
197 | local goal2 = {} | |
198 | goal2.Size = Vector3.new(1,1,1) | |
199 | ||
200 | local tween3 = tweenService:Create(object3, tweenInfo2, goal2) | |
201 | local object4 = bullet_clone2 | |
202 | local goal3 = {} | |
203 | goal3.Size = Vector3.new(3.5,3.5,3.5) | |
204 | local tween4 = tweenService:Create(object4, tweenInfo2, goal3) | |
205 | tween:Play() | |
206 | tween2:Play() | |
207 | tween3:Play() | |
208 | - | velocity.Velocity = bullet_clone.CFrame.lookVector * 20 |
208 | + | |
209 | fade:Play() | |
210 | - | wait(0.125) |
210 | + | |
211 | - | velocity:Destroy() |
211 | + | |
212 | - | velocity = nil |
212 | + | bullet_clone2:Destroy() |
213 | tween:Destroy() | |
214 | tween2:Destroy() | |
215 | tween3:Destroy() | |
216 | tween4:Destroy() | |
217 | end | |
218 | end) | |
219 | warn([["''Why do you need lasers that shoot out of your eyes, | |
220 | - | local remote = Instance.new("RemoteEvent", owner.Character) |
220 | + | When you can have a laser gun?''"]]) |