SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | ||
3 | ||
4 | - | local plr = game.Players.LocalPlayer |
4 | + | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | - | local mou = plr:GetMouse() |
6 | + | do |
7 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | ||
21 | --Creating fake input objects with fake variables | |
22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
26 | end} | |
27 | --Merged 2 functions into one by checking amount of arguments | |
28 | CAS.UnbindAction = CAS.BindAction | |
29 | ||
30 | --This function will trigger the events that have been :Connect()'ed | |
31 | local function te(self,ev,...) | |
32 | local t = m[ev] | |
33 | if t and t._fakeEvent and t.Function then | |
34 | t.Function(...) | |
35 | end | |
36 | end | |
37 | m.TrigEvent = te | |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=Player then return end | |
42 | if io.isMouse then | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | else | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = game:GetService("Players").LocalPlayer | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local Mouse = Player:GetMouse() | |
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | h,t=Mouse.Hit,Mouse.Target | |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
85 | end | |
86 | ||
87 | wait(1) | |
88 | ---------------------------[[[ VARIABLES ]]]--------------------------- | |
89 | ||
90 | local plr = game:service("Players").Rohan_Kishiba | |
91 | local chr = plr.Character | |
92 | local leftarm = false | |
93 | local active = false | |
94 | local curkey = "f" | |
95 | local stunneds = {} | |
96 | ||
97 | ---------------------------[[[ PARTS ]]]--------------------------- | |
98 | ||
99 | -- 1 - Glock | |
100 | obj1 = Instance.new("Model") | |
101 | obj1.Name = "Glock" | |
102 | obj1.Parent = chr | |
103 | ||
104 | -- 2 - Part | |
105 | obj2 = Instance.new("Part") | |
106 | obj2.CFrame = CFrame.new(Vector3.new(14.25, 3.51428652, 46.8584824)) * CFrame.Angles(0.69812995195389, 0, -0) | |
107 | obj2.TopSurface = Enum.SurfaceType.Smooth | |
108 | obj2.BottomSurface = Enum.SurfaceType.Smooth | |
109 | obj2.Material = Enum.Material.Metal | |
110 | obj2.Size = Vector3.new(0.300000012, 0.200000003, 0.200000003) | |
111 | obj2.Anchored = true | |
112 | obj2.BrickColor = BrickColor.new("Black") | |
113 | obj2.Friction = 0.30000001192093 | |
114 | obj2.Shape = Enum.PartType.Block | |
115 | obj2.CanCollide = false | |
116 | obj2.Parent = obj1 | |
117 | ||
118 | -- 3 - Top | |
119 | obj3 = Instance.new("Part") | |
120 | obj3.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.1499977)) * CFrame.Angles(-0, 0, -0) | |
121 | obj3.TopSurface = Enum.SurfaceType.Smooth | |
122 | obj3.BottomSurface = Enum.SurfaceType.Smooth | |
123 | obj3.Material = Enum.Material.Metal | |
124 | obj3.Size = Vector3.new(0.300000012, 0.300000012, 1.5) | |
125 | obj3.Anchored = true | |
126 | obj3.BrickColor = BrickColor.new("Ghost grey") | |
127 | obj3.Friction = 0.30000001192093 | |
128 | obj3.Shape = Enum.PartType.Block | |
129 | obj3.CanCollide = false | |
130 | obj3.Name = "Top" | |
131 | obj3.Parent = obj1 | |
132 | ||
133 | -- 4 - Top | |
134 | obj4 = Instance.new("Part") | |
135 | obj4.CFrame = CFrame.new(Vector3.new(14.25, 3.8499999, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0) | |
136 | obj4.TopSurface = Enum.SurfaceType.Smooth | |
137 | obj4.BottomSurface = Enum.SurfaceType.Smooth | |
138 | obj4.Material = Enum.Material.Metal | |
139 | obj4.Size = Vector3.new(0.200000003, 0.299999982, 0.300000012) | |
140 | obj4.Anchored = true | |
141 | obj4.BrickColor = BrickColor.new("Ghost grey") | |
142 | obj4.Friction = 0.30000001192093 | |
143 | obj4.Shape = Enum.PartType.Cylinder | |
144 | obj4.Name = "Top" | |
145 | obj4.CanCollide = false | |
146 | obj4.Parent = obj1 | |
147 | ||
148 | -- 5 - Part | |
149 | obj5 = Instance.new("Part") | |
150 | obj5.CFrame = CFrame.new(Vector3.new(14.25, 3.35359001, 47.1499939)) * CFrame.Angles(-1.5707978010178, 0, -0) | |
151 | obj5.TopSurface = Enum.SurfaceType.Smooth | |
152 | obj5.BottomSurface = Enum.SurfaceType.Smooth | |
153 | obj5.Material = Enum.Material.Metal | |
154 | obj5.Size = Vector3.new(0.300000012, 0.200000003, 0.299999982) | |
155 | obj5.Anchored = true | |
156 | obj5.BrickColor = BrickColor.new("Black") | |
157 | obj5.Friction = 0.30000001192093 | |
158 | obj5.Shape = Enum.PartType.Block | |
159 | obj5.CanCollide = false | |
160 | obj5.Parent = obj1 | |
161 | ||
162 | -- 6 - Part | |
163 | obj6 = Instance.new("Part") | |
164 | obj6.CFrame = CFrame.new(Vector3.new(14.25, 3.5999999, 47.1499977)) * CFrame.Angles(-0, 0, -0) | |
165 | obj6.TopSurface = Enum.SurfaceType.Smooth | |
166 | obj6.BottomSurface = Enum.SurfaceType.Smooth | |
167 | obj6.Material = Enum.Material.Metal | |
168 | obj6.Size = Vector3.new(0.300000012, 0.200000003, 1.5) | |
169 | obj6.Anchored = true | |
170 | obj6.BrickColor = BrickColor.new("Black") | |
171 | obj6.CanCollide = false | |
172 | obj6.Friction = 0.30000001192093 | |
173 | obj6.Shape = Enum.PartType.Block | |
174 | obj6.Parent = obj1 | |
175 | ||
176 | -- 7 - Part | |
177 | obj7 = Instance.new("Part") | |
178 | obj7.CFrame = CFrame.new(Vector3.new(14.25, 3.60000014, 47.8999977)) * CFrame.Angles(0, 1.5707963705063, 0) | |
179 | obj7.TopSurface = Enum.SurfaceType.Smooth | |
180 | obj7.BottomSurface = Enum.SurfaceType.Smooth | |
181 | obj7.Material = Enum.Material.Metal | |
182 | obj7.Size = Vector3.new(0.200000003, 0.200000003, 0.300000012) | |
183 | obj7.Anchored = true | |
184 | obj7.BrickColor = BrickColor.new("Black") | |
185 | obj7.CanCollide = false | |
186 | obj7.Friction = 0.30000001192093 | |
187 | obj7.Shape = Enum.PartType.Cylinder | |
188 | obj7.Parent = obj1 | |
189 | ||
190 | -- 8 - Part | |
191 | obj8 = Instance.new("Part") | |
192 | obj8.CFrame = CFrame.new(Vector3.new(14.25, 3.15358996, 46.8499985)) * CFrame.Angles(1.1920913323138e-007, 0, -0) | |
193 | obj8.TopSurface = Enum.SurfaceType.Smooth | |
194 | obj8.BottomSurface = Enum.SurfaceType.Smooth | |
195 | obj8.Material = Enum.Material.Metal | |
196 | obj8.Size = Vector3.new(0.300000012, 0.200000003, 0.699999988) | |
197 | obj8.Anchored = true | |
198 | obj8.BrickColor = BrickColor.new("Black") | |
199 | obj8.Friction = 0.30000001192093 | |
200 | obj8.CanCollide = false | |
201 | obj8.Shape = Enum.PartType.Block | |
202 | obj8.Parent = obj1 | |
203 | ||
204 | -- 9 - Part | |
205 | obj9 = Instance.new("Part") | |
206 | obj9.CFrame = CFrame.new(Vector3.new(14.25, 3.27858996, 46.5067024)) * CFrame.Angles(-1.0471963882446, 0, -0) | |
207 | obj9.TopSurface = Enum.SurfaceType.Smooth | |
208 | obj9.BottomSurface = Enum.SurfaceType.Smooth | |
209 | obj9.Material = Enum.Material.Metal | |
210 | obj9.Size = Vector3.new(0.300000012, 0.300000012, 0.699999988) | |
211 | obj9.Anchored = true | |
212 | obj9.BrickColor = BrickColor.new("Black") | |
213 | obj9.CanCollide = false | |
214 | obj9.Friction = 0.30000001192093 | |
215 | obj9.Shape = Enum.PartType.Block | |
216 | obj9.Parent = obj1 | |
217 | ||
218 | local previous = nil | |
219 | for i,v in pairs(obj1:GetChildren()) do | |
220 | if v:IsA('BasePart') then | |
221 | if previous then | |
222 | local weld = Instance.new('Weld',v) | |
223 | weld.Part0 = v | |
224 | weld.Part1 = previous | |
225 | weld.C0 = v.CFrame:inverse() * previous.CFrame | |
226 | previous.Anchored = false | |
227 | end | |
228 | previous = v | |
229 | end | |
230 | end | |
231 | previous.Anchored = false | |
232 | ||
233 | ---------------------------[[[ FUNCTIONS ]]]--------------------------- | |
234 | ||
235 | function notify(msg,forever) | |
236 | local doit = coroutine.wrap(function() | |
237 | for i,v in pairs(plr.PlayerGui:GetChildren()) do | |
238 | if v.Name == "Notification" and v:IsA('ScreenGui') then | |
239 | v:Destroy() | |
240 | end | |
241 | end | |
242 | local gui = Instance.new('ScreenGui',plr.PlayerGui) | |
243 | gui.Name = "Notification" | |
244 | local frame = Instance.new('Frame',gui) | |
245 | frame.Position = UDim2.new(0,0,0,0) | |
246 | frame.Size = UDim2.new(1,0,0.2,0) | |
247 | frame.BackgroundTransparency = 1 | |
248 | local txt = Instance.new('TextLabel',frame) | |
249 | txt.TextColor3 = Color3.new(255,255,255) | |
250 | txt.TextStrokeColor3 = Color3.new(0, 0, 0) | |
251 | txt.TextStrokeTransparency = 0 | |
252 | txt.BackgroundTransparency = 1 | |
253 | txt.Text = "" | |
254 | txt.Size = UDim2.new(1,0,0.3,0) | |
255 | txt.Position = UDim2.new(0,0,0.4,0) | |
256 | txt.TextScaled = true | |
257 | txt.Font = "Code" | |
258 | txt.TextXAlignment = "Center" | |
259 | local tap = Instance.new("Sound") | |
260 | tap.Parent = plr.Backpack | |
261 | tap.SoundId = "rbxassetid://147982968" | |
262 | tap.TimePosition = 0.1 | |
263 | local str = msg | |
264 | local len = string.len(str) | |
265 | for i=1,len do | |
266 | txt.Text = string.sub(str,1,i) | |
267 | local pitche = math.random(2, 4) | |
268 | tap.PlaybackSpeed = pitche | |
269 | tap:Play() | |
270 | wait(0.05) | |
271 | end | |
272 | if forever == false then | |
273 | wait(1) | |
274 | while txt.TextTransparency < 1 do | |
275 | txt.TextTransparency = txt.TextTransparency + 0.1 | |
276 | txt.TextStrokeTransparency = txt.TextStrokeTransparency + 0.1 | |
277 | wait() | |
278 | end | |
279 | gui:Destroy() | |
280 | end | |
281 | end) | |
282 | doit() | |
283 | end | |
284 | ||
285 | ||
286 | function damage(playa,hita) | |
287 | local hitz = hita.Name | |
288 | local heyy = hitz | |
289 | if hitz == "Right Arm" then | |
290 | local Limb = playa:FindFirstChild("Right Arm") | |
291 | local ters = playa:FindFirstChild('Torso') | |
292 | if Limb and ters then | |
293 | if ters:FindFirstChild('Right Shoulder') then ters["Right Shoulder"]:Destroy() end | |
294 | for i,v in pairs(Limb:GetChildren()) do | |
295 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then | |
296 | v:Destroy() | |
297 | end | |
298 | end | |
299 | Limb.CFrame = ters.CFrame * CFrame.new(1.5, 0, 0) | |
300 | local Joint = Instance.new("Glue") | |
301 | Joint.Name = "RightShoulder" | |
302 | Joint.Part0 = ters | |
303 | Joint.Part1 = Limb | |
304 | Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
305 | Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
306 | Joint.Parent = ters | |
307 | ||
308 | local B = Instance.new("Part") | |
309 | B.TopSurface = 0 | |
310 | B.BottomSurface = 0 | |
311 | B.formFactor = "Symmetric" | |
312 | B.Size = Vector3.new(1, 1, 1) | |
313 | B.Transparency = 1 | |
314 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
315 | B.Parent = playa | |
316 | local W = Instance.new("Weld") | |
317 | W.Part0 = Limb | |
318 | W.Part1 = B | |
319 | W.C0 = CFrame.new(0, -0.5, 0) | |
320 | W.Parent = Limb | |
321 | end | |
322 | elseif hitz == "Left Arm" then | |
323 | local Limb = playa:FindFirstChild("Left Arm") | |
324 | local ters = playa:FindFirstChild('Torso') | |
325 | if Limb and ters then | |
326 | if ters:FindFirstChild('Left Shoulder') then ters["Left Shoulder"]:Destroy() end | |
327 | for i,v in pairs(Limb:GetChildren()) do | |
328 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then | |
329 | v:Destroy() | |
330 | end | |
331 | end | |
332 | Limb.CFrame = ters.CFrame * CFrame.new(-1.5, 0, 0) | |
333 | local Joint = Instance.new("Glue") | |
334 | Joint.Name = "LeftShoulder" | |
335 | Joint.Part0 = ters | |
336 | Joint.Part1 = Limb | |
337 | Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
338 | Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
339 | Joint.Parent = ters | |
340 | local B = Instance.new("Part") | |
341 | B.TopSurface = 0 | |
342 | B.BottomSurface = 0 | |
343 | B.formFactor = "Symmetric" | |
344 | B.Size = Vector3.new(1, 1, 1) | |
345 | B.Transparency = 1 | |
346 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
347 | B.Parent = playa | |
348 | local W = Instance.new("Weld") | |
349 | W.Part0 = ters | |
350 | W.Part1 = B | |
351 | W.C0 = CFrame.new(0, -0.5, 0) | |
352 | W.Parent = Limb | |
353 | end | |
354 | elseif hitz == "Right Leg" then | |
355 | local Limb = playa:FindFirstChild("Right Leg") | |
356 | local ters = playa:FindFirstChild('Torso') | |
357 | if Limb and ters then | |
358 | if ters:FindFirstChild('Right Hip') then ters["Right Hip"]:Destroy() end | |
359 | for i,v in pairs(Limb:GetChildren()) do | |
360 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then | |
361 | v:Destroy() | |
362 | end | |
363 | end | |
364 | Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0) | |
365 | local Joint = Instance.new("Glue") | |
366 | Joint.Name = "Right Hip" | |
367 | Joint.Part0 = ters | |
368 | Joint.Part1 = Limb | |
369 | Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
370 | Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
371 | Joint.Parent = ters | |
372 | local B = Instance.new("Part") | |
373 | B.TopSurface = 0 | |
374 | B.BottomSurface = 0 | |
375 | B.formFactor = "Symmetric" | |
376 | B.Size = Vector3.new(1, 1, 1) | |
377 | B.Transparency = 1 | |
378 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
379 | B.Parent = playa | |
380 | local W = Instance.new("Weld") | |
381 | W.Part0 = Limb | |
382 | W.Part1 = B | |
383 | W.C0 = CFrame.new(0, -0.5, 0) | |
384 | W.Parent = Limb | |
385 | if playa:FindFirstChildOfClass('Humanoid') then | |
386 | local hum = playa:FindFirstChildOfClass('Humanoid') | |
387 | local target = playa | |
388 | if target:FindFirstChild('HumanoidRootPart') then | |
389 | target.HumanoidRootPart:Destroy() | |
390 | end | |
391 | local found = false | |
392 | for i,v in pairs(stunneds) do | |
393 | if v == hum then | |
394 | found = true | |
395 | end | |
396 | end | |
397 | if found == false then | |
398 | table.insert(stunneds,hum) | |
399 | end | |
400 | end | |
401 | end | |
402 | elseif hitz == "Left Leg" then | |
403 | local Limb = playa:FindFirstChild("Left Leg") | |
404 | local ters = playa:FindFirstChild('Torso') | |
405 | if Limb and ters then | |
406 | if ters:FindFirstChild('Left Hip') then ters["Left Hip"]:Destroy() end | |
407 | for i,v in pairs(Limb:GetChildren()) do | |
408 | if v:IsA('Weld') or v:IsA('Motor6D') or v:IsA('Glue') then | |
409 | v:Destroy() | |
410 | end | |
411 | end | |
412 | Limb.CFrame = ters.CFrame * CFrame.new(0.5, -2, 0) | |
413 | Limb.CFrame = ters.CFrame * CFrame.new(-0.5, -2, 0) | |
414 | local Joint = Instance.new("Glue") | |
415 | Joint.Name = "LeftHip" | |
416 | Joint.Part0 = ters | |
417 | Joint.Part1 = Limb | |
418 | Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
419 | Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
420 | Joint.Parent = ters | |
421 | ||
422 | local B = Instance.new("Part") | |
423 | B.TopSurface = 0 | |
424 | B.BottomSurface = 0 | |
425 | B.formFactor = "Symmetric" | |
426 | B.Size = Vector3.new(1, 1, 1) | |
427 | B.Transparency = 1 | |
428 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
429 | B.Parent = playa | |
430 | local W = Instance.new("Weld") | |
431 | W.Part0 = Limb | |
432 | W.Part1 = B | |
433 | W.C0 = CFrame.new(0, -0.5, 0) | |
434 | W.Parent = Limb | |
435 | Limb.CanCollide = false | |
436 | if playa:FindFirstChildOfClass('Humanoid') then | |
437 | local hum = playa:FindFirstChildOfClass('Humanoid') | |
438 | local target = playa | |
439 | if target:FindFirstChild('HumanoidRootPart') then | |
440 | target.HumanoidRootPart:Destroy() | |
441 | end | |
442 | local found = false | |
443 | for i,v in pairs(stunneds) do | |
444 | if v == hum then | |
445 | found = true | |
446 | end | |
447 | end | |
448 | if found == false then | |
449 | table.insert(stunneds,hum) | |
450 | end | |
451 | end | |
452 | end | |
453 | else | |
454 | local playa2 = playa | |
455 | playa.Archivable = true | |
456 | local playa = playa:Clone() | |
457 | playa.Archivable = false | |
458 | playa2:Destroy() | |
459 | playa.Parent = workspace | |
460 | local Gibs = game.Workspace | |
461 | print(playa) | |
462 | local Torso = playa.Torso | |
463 | local Head = playa:FindFirstChild("Head") | |
464 | local function Scan(ch) | |
465 | local e | |
466 | for e = 1,#ch do | |
467 | Scan(ch[e]:GetChildren()) | |
468 | if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then | |
469 | ch[e]:remove() | |
470 | end | |
471 | end | |
472 | end | |
473 | Scan(playa:GetChildren()) | |
474 | if playa:FindFirstChild('HumanoidRootPart') then | |
475 | playa:FindFirstChild('HumanoidRootPart'):Destroy() | |
476 | end | |
477 | local hum2 = playa:FindFirstChildOfClass("Humanoid") | |
478 | ||
479 | ||
480 | if hum2 ~= nil then | |
481 | hum2.Name = "Humanoid2" | |
482 | hum2.PlatformStand = true | |
483 | hum2.Health = 0 | |
484 | end | |
485 | local ch = playa:GetChildren() | |
486 | local i | |
487 | for i = 1,#ch do | |
488 | if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then | |
489 | ch[i]:remove() | |
490 | end | |
491 | end | |
492 | ||
493 | if Head then | |
494 | local Neck = Instance.new("Weld") | |
495 | Neck.Name = "Neck" | |
496 | Neck.Part0 = Torso | |
497 | Neck.Part1 = Head | |
498 | Neck.C0 = CFrame.new(0, 1.5, 0) | |
499 | Neck.C1 = CFrame.new() | |
500 | Neck.Parent = Torso | |
501 | end | |
502 | local Limb = playa:FindFirstChild("Right Arm") | |
503 | if Limb then | |
504 | ||
505 | Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0) | |
506 | local Joint = Instance.new("Glue") | |
507 | Joint.Name = "RightShoulder" | |
508 | Joint.Part0 = Torso | |
509 | Joint.Part1 = Limb | |
510 | Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
511 | Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
512 | Joint.Parent = Torso | |
513 | ||
514 | local B = Instance.new("Part") | |
515 | B.TopSurface = 0 | |
516 | B.BottomSurface = 0 | |
517 | B.formFactor = "Symmetric" | |
518 | B.Size = Vector3.new(1, 1, 1) | |
519 | B.Transparency = 1 | |
520 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
521 | B.Parent = playa | |
522 | local W = Instance.new("Weld") | |
523 | W.Part0 = Limb | |
524 | W.Part1 = B | |
525 | W.C0 = CFrame.new(0, -0.5, 0) | |
526 | W.Parent = Limb | |
527 | end | |
528 | local Limb = playa:FindFirstChild("Left Arm") | |
529 | if Limb then | |
530 | ||
531 | Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0) | |
532 | local Joint = Instance.new("Glue") | |
533 | Joint.Name = "LeftShoulder" | |
534 | Joint.Part0 = Torso | |
535 | Joint.Part1 = Limb | |
536 | Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
537 | Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
538 | Joint.Parent = Torso | |
539 | ||
540 | local B = Instance.new("Part") | |
541 | B.TopSurface = 0 | |
542 | B.BottomSurface = 0 | |
543 | B.formFactor = "Symmetric" | |
544 | B.Size = Vector3.new(1, 1, 1) | |
545 | B.Transparency = 1 | |
546 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
547 | - | local MousePosition = mou.Hit.p |
547 | + | |
548 | local W = Instance.new("Weld") | |
549 | W.Part0 = Limb | |
550 | W.Part1 = B | |
551 | W.C0 = CFrame.new(0, -0.5, 0) | |
552 | W.Parent = Limb | |
553 | end | |
554 | local Limb = playa:FindFirstChild("Right Leg") | |
555 | if Limb then | |
556 | ||
557 | Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0) | |
558 | local Joint = Instance.new("Glue") | |
559 | Joint.Name = "RightHip" | |
560 | Joint.Part0 = Torso | |
561 | Joint.Part1 = Limb | |
562 | Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) | |
563 | - | local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p) |
563 | + | |
564 | Joint.Parent = Torso | |
565 | ||
566 | - | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0) |
566 | + | |
567 | B.TopSurface = 0 | |
568 | - | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0) |
568 | + | |
569 | B.formFactor = "Symmetric" | |
570 | B.Size = Vector3.new(1, 1, 1) | |
571 | B.Transparency = 1 | |
572 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
573 | B.Parent = playa | |
574 | local W = Instance.new("Weld") | |
575 | W.Part0 = Limb | |
576 | W.Part1 = B | |
577 | W.C0 = CFrame.new(0, -0.5, 0) | |
578 | W.Parent = Limb | |
579 | end | |
580 | local Limb = playa:FindFirstChild("Left Leg") | |
581 | if Limb then | |
582 | ||
583 | Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0) | |
584 | - | local MousePosition = mou.Hit.p |
584 | + | |
585 | Joint.Name = "LeftHip" | |
586 | Joint.Part0 = Torso | |
587 | Joint.Part1 = Limb | |
588 | Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
589 | Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) | |
590 | Joint.Parent = Torso | |
591 | ||
592 | local B = Instance.new("Part") | |
593 | B.TopSurface = 0 | |
594 | B.BottomSurface = 0 | |
595 | B.formFactor = "Symmetric" | |
596 | B.Size = Vector3.new(1, 1, 1) | |
597 | B.Transparency = 1 | |
598 | B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0) | |
599 | - | local Point = Torso.CFrame:vectorToObjectSpace(mou.Hit.p-Torso.CFrame.p) |
599 | + | |
600 | local W = Instance.new("Weld") | |
601 | W.Part0 = Limb | |
602 | - | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(90),0) |
602 | + | |
603 | W.C0 = CFrame.new(0, -0.5, 0) | |
604 | - | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mou.Hit.X,Torso.Position.Y,mou.Hit.Z))*CFrame.Angles(0,math.rad(-90),0) |
604 | + | |
605 | end | |
606 | --[ | |
607 | local Bar = Instance.new("Part") | |
608 | Bar.TopSurface = 0 | |
609 | Bar.BottomSurface = 0 | |
610 | Bar.formFactor = "Symmetric" | |
611 | Bar.Size = Vector3.new(1, 1, 1) | |
612 | Bar.Transparency = 1 | |
613 | Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0) | |
614 | Bar.Parent = playa | |
615 | local Weld = Instance.new("Weld") | |
616 | Weld.Part0 = Torso | |
617 | - | if mou.Target then |
617 | + | |
618 | - | local humanoid = mou.Target.Parent:FindFirstChildOfClass("Humanoid") |
618 | + | |
619 | Weld.Parent = Torso | |
620 | - | humanoid = mou.Target.Parent.Parent:FindFirstChildOfClass("Humanoid") |
620 | + | |
621 | playa.Parent = Gibs | |
622 | game.Debris:AddItem(playa, 12) | |
623 | end | |
624 | - | damage(humanoid.Parent,mou.Target) |
624 | + | |
625 | ||
626 | ||
627 | function calculate() | |
628 | if leftarm and chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Left Shoulder") and chr:FindFirstChild('Left Arm') then | |
629 | local Head = plr.Character.Head | |
630 | local RightShoulder = plr.Character.Torso["Left Shoulder"] | |
631 | local RightArm = plr.Character["Left Arm"] | |
632 | local MousePosition = mouse.Hit.p | |
633 | local ToMouse = (MousePosition - Head.Position).unit | |
634 | local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0))) | |
635 | local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((-Head.Size.X / 2) + (-RightArm.Size.X / 2)), ((-Head.Size.Y / 2) - (-RightArm.Size.Z / 2)), 0))) | |
636 | local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(-1 ,0, -1)).unit | |
637 | - | local distance = (obj4.CFrame.p - mou.Hit.p).magnitude |
637 | + | |
638 | local LateralAngle = math.acos(ToMouseRightArm:Dot(Look)) | |
639 | - | beam.CFrame = CFrame.new(obj4.CFrame.p, mou.Hit.p) * CFrame.new(0, 0, -distance / 2) |
639 | + | |
640 | LateralAngle = 0 | |
641 | end | |
642 | local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm) | |
643 | --[[ | |
644 | if LateralAngle > (math.pi / 2) then | |
645 | LateralAngle = (math.pi / 2) | |
646 | if chr:FindFirstChild('Torso') then | |
647 | local Torso = chr.Torso | |
648 | local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p) | |
649 | if Point.Z > 0 then | |
650 | if Point.X > 0 then | |
651 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0) | |
652 | elseif Point.X < 0 then | |
653 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0) | |
654 | end | |
655 | end | |
656 | end | |
657 | end | |
658 | ]]-- | |
659 | print(LateralAngle) | |
660 | warn(math.pi / 2) | |
661 | if Cross.Y < 0 then | |
662 | LateralAngle = -LateralAngle | |
663 | end | |
664 | return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2)) | |
665 | elseif chr:FindFirstChild('Head') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild("Right Shoulder") and chr:FindFirstChild('Right Arm') then | |
666 | local Head = plr.Character.Head | |
667 | local RightShoulder = plr.Character.Torso["Right Shoulder"] | |
668 | local RightArm = plr.Character["Right Arm"] | |
669 | local MousePosition = mouse.Hit.p | |
670 | local ToMouse = (MousePosition - Head.Position).unit | |
671 | local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0))) | |
672 | local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0))) | |
673 | local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit | |
674 | local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit | |
675 | local LateralAngle = math.acos(ToMouseRightArm:Dot(Look)) | |
676 | if tostring(LateralAngle) == "-1.#IND" then | |
677 | LateralAngle = 0 | |
678 | end | |
679 | local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm) | |
680 | if LateralAngle > (math.pi / 2) then | |
681 | LateralAngle = (math.pi / 2) | |
682 | if chr:FindFirstChild('Torso') then | |
683 | local Torso = chr.Torso | |
684 | local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p) | |
685 | if Point.Z > 0 then | |
686 | if Point.X > 0 then | |
687 | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(90),0) | |
688 | elseif Point.X < 0 then | |
689 | - | mou.KeyDown:connect(function(key) |
689 | + | Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-90),0) |
690 | end | |
691 | end | |
692 | end | |
693 | end | |
694 | if Cross.Y < 0 then | |
695 | LateralAngle = -LateralAngle | |
696 | end | |
697 | return(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2)) | |
698 | end | |
699 | end | |
700 | ||
701 | function fire() | |
702 | if mouse.Target then | |
703 | local humanoid = mouse.Target.Parent:FindFirstChildOfClass("Humanoid") | |
704 | if not humanoid then | |
705 | humanoid = mouse.Target.Parent.Parent:FindFirstChildOfClass("Humanoid") | |
706 | end | |
707 | if humanoid then | |
708 | local coru = coroutine.wrap(function() | |
709 | damage(humanoid.Parent,mouse.Target) | |
710 | end) | |
711 | coru() | |
712 | end | |
713 | end | |
714 | local beam = Instance.new("Part", workspace) | |
715 | beam.BrickColor = BrickColor.new("Bright yellow") | |
716 | beam.FormFactor = "Custom" | |
717 | beam.Material = "Neon" | |
718 | beam.Transparency = 0.25 | |
719 | beam.Anchored = true | |
720 | beam.Locked = true | |
721 | beam.CanCollide = false | |
722 | local distance = (obj4.CFrame.p - mouse.Hit.p).magnitude | |
723 | beam.Size = Vector3.new(0.2, 0.2, distance) | |
724 | beam.CFrame = CFrame.new(obj4.CFrame.p, mouse.Hit.p) * CFrame.new(0, 0, -distance / 2) | |
725 | - | mou.Button1Down:connect(function() |
725 | + | |
726 | local sound = Instance.new('Sound',obj4) | |
727 | sound.SoundId = 'rbxassetid://139593133' | |
728 | sound.Volume = 3 | |
729 | sound.EmitterSize = 40 | |
730 | sound.MaxDistance = 450 | |
731 | sound:Play() | |
732 | game:GetService("Debris"):AddItem(beam, sound.TimeLength) | |
733 | end | |
734 | ||
735 | ---------------------------[[[ SCRIPT ]]]--------------------------- | |
736 | if chr:FindFirstChild('Left Arm') == nil or chr:FindFirstChild('Torso') == nil or chr.Torso:FindFirstChild('Left Shoulder') == nil then | |
737 | leftarm = false | |
738 | end | |
739 | local weldas = Instance.new('Weld',obj2) | |
740 | if leftarm and chr:FindFirstChild('Left Arm') then | |
741 | weldas.Part0 = obj2 | |
742 | weldas.Part1 = chr["Left Arm"] | |
743 | weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180)) | |
744 | elseif chr:FindFirstChild('Right Arm') then | |
745 | weldas.Part0 = obj2 | |
746 | weldas.Part1 = chr["Right Arm"] | |
747 | weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180)) | |
748 | end | |
749 | ||
750 | ||
751 | if leftarm and chr:FindFirstChild('Left Arm') and chr:FindFirstChild('Torso') and chr.Torso:FindFirstChild('Left Shoulder') then | |
752 | chr:FindFirstChild('Left Arm').AncestryChanged:connect(function(me,par) | |
753 | if par ~= chr and chr:FindFirstChild('Right Arm') then | |
754 | if obj2 and obj2:FindFirstChildOfClass('Weld') then | |
755 | obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"] | |
756 | end | |
757 | leftarm = false | |
758 | end | |
759 | end) | |
760 | chr.Torso:FindFirstChild('Left Shoulder').AncestryChanged:connect(function(me,par) | |
761 | if par ~= chr:FindFirstChild('Torso') and chr:FindFirstChild('Right Arm') then | |
762 | if obj2 and obj2:FindFirstChildOfClass('Weld') then | |
763 | obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"] | |
764 | end | |
765 | end | |
766 | leftarm = false | |
767 | end) | |
768 | elseif leftarm then | |
769 | if obj2 and obj2:FindFirstChildOfClass('Weld') and chr:FindFirstChild('Right Arm') then | |
770 | obj2:FindFirstChildOfClass('Weld').Part1 = chr["Right Arm"] | |
771 | end | |
772 | end | |
773 | ||
774 | mouse.KeyDown:connect(function(key) | |
775 | if key == string.lower(curkey) then | |
776 | active = not active | |
777 | end | |
778 | end) | |
779 | ||
780 | plr.Chatted:connect(function(msg) | |
781 | if string.lower(string.sub(msg,1,5)) == "!bind" then | |
782 | curkey = string.lower(string.sub(msg,7,7)) | |
783 | notify([[Changed key for equip/unequip to "]]..curkey..[[".]],false) | |
784 | end | |
785 | end) | |
786 | ||
787 | game:GetService('RunService').Stepped:connect(function() | |
788 | if active and chr:FindFirstChild('Torso') then | |
789 | if leftarm then | |
790 | chr.Torso["Left Shoulder"].C0 = calculate() | |
791 | else | |
792 | chr.Torso["Right Shoulder"].C0 = calculate() | |
793 | end | |
794 | weldas.Part1 = chr["Right Arm"] | |
795 | weldas.C0 = CFrame.new(0,-0.85,-0.30)*CFrame.Angles(math.rad(50),math.rad(0),math.rad(180)) | |
796 | elseif chr:FindFirstChild('Torso') and (chr.Torso:FindFirstChild('Left Shoulder') or chr.Torso:FindFirstChild('Right Shoulder')) then | |
797 | if leftarm then | |
798 | chr.Torso["Left Shoulder"].C0 = CFrame.new(-1,0.5,0)*CFrame.Angles(0,-math.pi/2,0) | |
799 | else | |
800 | chr.Torso["Right Shoulder"].C0 = CFrame.new(1,0.5,0)*CFrame.Angles(0,math.pi/2,0) | |
801 | end | |
802 | weldas.Part1 = chr.Torso | |
803 | weldas.C0 = CFrame.new(-1,0,-1)*CFrame.Angles(math.rad(-90),0,0) | |
804 | end | |
805 | for i,v in pairs(stunneds) do | |
806 | v.PlatformStand = true | |
807 | end | |
808 | end) | |
809 | ||
810 | mouse.Button1Down:connect(function() | |
811 | if active then | |
812 | fire() | |
813 | end | |
814 | end) | |
815 | ||
816 | notify([[Chat "!bind [key]" to bind a different key to equip/unequip. Current key is "f".]],false) |