· 8 years ago · Jul 10, 2018, 10:02 PM
1--Created with PenguinAnonymous's compiler
2--PenguinAnonymous is not responsible for damages caused to your game
3--This plugin does not remove things
4--PenguinAnonymous cannot be held resonsible for manual deletion for the purpose of testing
5--Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
6--Thank you for using my plugin and enjoy :)
7--It is free to use
8--If you use this plugin to create your own, please give me credit
9--Z_V edited my plugin to look like his own and published it without giving me credit, and that makes me very angry
10--Errors: Attachment,Animator,Accessory,Camera
11local runDummyScript = function(f,scri)
12local oldenv = getfenv(f)
13local newenv = setmetatable({}, {
14__index = function(_, k)
15if k:lower() == 'script' then
16return scri
17else
18return oldenv[k]
19end
20end
21})
22setfenv(f, newenv)
23ypcall(function() f() end)
24end
25cors = {}
26mas = Instance.new("Model",game:GetService("Lighting"))
27mas.Name = "CompiledModel"
28o1 = Instance.new("Model")
29o2 = Instance.new("Part")
30o3 = Instance.new("SpecialMesh")
31o6 = Instance.new("Sound")
32o7 = Instance.new("RemoteEvent")
33o8 = Instance.new("Sound")
34o9 = Instance.new("RemoteEvent")
35o10 = Instance.new("Sound")
36o11 = Instance.new("RemoteEvent")
37o12 = Instance.new("Sound")
38o13 = Instance.new("RemoteEvent")
39o14 = Instance.new("Sound")
40o15 = Instance.new("RemoteEvent")
41o16 = Instance.new("Sound")
42o17 = Instance.new("RemoteEvent")
43o18 = Instance.new("Sound")
44o19 = Instance.new("RemoteEvent")
45o20 = Instance.new("Sound")
46o21 = Instance.new("RemoteEvent")
47o22 = Instance.new("Sound")
48o23 = Instance.new("RemoteEvent")
49o24 = Instance.new("Sound")
50o25 = Instance.new("Sound")
51o26 = Instance.new("Sound")
52o27 = Instance.new("PointLight")
53o28 = Instance.new("Decal")
54o29 = Instance.new("Weld")
55o30 = Instance.new("Part")
56o31 = Instance.new("Decal")
57o33 = Instance.new("Motor6D")
58o34 = Instance.new("Motor6D")
59o35 = Instance.new("Motor6D")
60o36 = Instance.new("Motor6D")
61o37 = Instance.new("Motor6D")
62o38 = Instance.new("Part")
63o39 = Instance.new("Weld")
64o40 = Instance.new("Part")
65o41 = Instance.new("Weld")
66o42 = Instance.new("Weld")
67o43 = Instance.new("Part")
68o44 = Instance.new("Part")
69o45 = Instance.new("Humanoid")
70o46 = Instance.new("Model")
71o47 = Instance.new("Model")
72o49 = Instance.new("Part")
73o51 = Instance.new("Motor6D")
74o52 = Instance.new("Script")
75o53 = Instance.new("LocalScript")
76o54 = Instance.new("Script")
77o56 = Instance.new("Part")
78o57 = Instance.new("SpecialMesh")
79o59 = Instance.new("Vector3Value")
80o60 = Instance.new("Weld")
81o61 = Instance.new("BodyColors")
82o63 = Instance.new("Part")
83o64 = Instance.new("SpecialMesh")
84o66 = Instance.new("Vector3Value")
85o67 = Instance.new("Weld")
86o69 = Instance.new("Pants")
87o70 = Instance.new("ShirtGraphic")
88o71 = Instance.new("CharacterMesh")
89o72 = Instance.new("CharacterMesh")
90o73 = Instance.new("Animation")
91o75 = Instance.new("Part")
92o76 = Instance.new("SpecialMesh")
93o77 = Instance.new("Vector3Value")
94o78 = Instance.new("Shirt")
95o79 = Instance.new("CharacterMesh")
96o80 = Instance.new("CharacterMesh")
97o81 = Instance.new("Script")
98o82 = Instance.new("StringValue")
99o83 = Instance.new("Animation")
100o84 = Instance.new("StringValue")
101o85 = Instance.new("Animation")
102o86 = Instance.new("StringValue")
103o87 = Instance.new("Animation")
104o88 = Instance.new("NumberValue")
105o89 = Instance.new("Animation")
106o90 = Instance.new("NumberValue")
107o91 = Instance.new("StringValue")
108o92 = Instance.new("Animation")
109o93 = Instance.new("StringValue")
110o94 = Instance.new("Animation")
111o95 = Instance.new("StringValue")
112o96 = Instance.new("Animation")
113o97 = Instance.new("StringValue")
114o98 = Instance.new("Animation")
115o99 = Instance.new("StringValue")
116o100 = Instance.new("Animation")
117o101 = Instance.new("Script")
118o102 = Instance.new("Script")
119o103 = Instance.new("Script")
120o104 = Instance.new("Tool")
121o105 = Instance.new("Part")
122o106 = Instance.new("Sound")
123o107 = Instance.new("FileMesh")
124o108 = Instance.new("ParticleEmitter")
125o109 = Instance.new("ParticleEmitter")
126o110 = Instance.new("ParticleEmitter")
127o111 = Instance.new("ParticleEmitter")
128o112 = Instance.new("Sound")
129o113 = Instance.new("LocalScript")
130o114 = Instance.new("LocalScript")
131o115 = Instance.new("ScreenGui")
132o116 = Instance.new("TextLabel")
133o117 = Instance.new("Sound")
134o118 = Instance.new("Sound")
135o119 = Instance.new("Sound")
136o120 = Instance.new("CharacterMesh")
137o1.Name = "Clown"
138o1.Parent = mas
139o1.PrimaryPart = o2
140o2.Name = "Head"
141o2.Parent = o1
142o2.BrickColor = BrickColor.new("Institutional white")
143o2.Position = Vector3.new(12.859992, 4.50000095, -76.3799744)
144o2.FormFactor = Enum.FormFactor.Symmetric
145o2.Size = Vector3.new(2, 1, 1)
146o2.CFrame = CFrame.new(12.859992, 4.50000095, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
147o2.TopSurface = Enum.SurfaceType.Smooth
148o2.Color = Color3.new(0.972549, 0.972549, 0.972549)
149o2.Position = Vector3.new(12.859992, 4.50000095, -76.3799744)
150o3.Parent = o2
151o3.Scale = Vector3.new(1.25, 1.25, 1.25)
152o6.Name = "GettingUp"
153o6.Parent = o2
154o6.SoundId = "rbxasset://sounds/action_get_up.mp3"
155o6.Volume = 0.64999997615814
156o7.Name = "CharacterSoundEvent"
157o7.Parent = o6
158o8.Name = "Died"
159o8.Parent = o2
160o8.SoundId = "rbxasset://sounds/uuhhh.mp3"
161o8.Volume = 0.64999997615814
162o9.Name = "CharacterSoundEvent"
163o9.Parent = o8
164o10.Name = "FreeFalling"
165o10.Parent = o2
166o10.SoundId = "rbxasset://sounds/action_falling.mp3"
167o10.TimePosition = 0.23380919942974
168o10.Volume = 0
169o10.Looped = true
170o11.Name = "CharacterSoundEvent"
171o11.Parent = o10
172o12.Name = "Jumping"
173o12.Parent = o2
174o12.SoundId = "rbxasset://sounds/action_jump.mp3"
175o12.Volume = 0.64999997615814
176o13.Name = "CharacterSoundEvent"
177o13.Parent = o12
178o14.Name = "Landing"
179o14.Parent = o2
180o14.SoundId = "rbxasset://sounds/action_jump_land.mp3"
181o14.Volume = 1
182o15.Name = "CharacterSoundEvent"
183o15.Parent = o14
184o16.Name = "Splash"
185o16.Parent = o2
186o16.SoundId = "rbxasset://sounds/impact_water.mp3"
187o16.Volume = 0.64999997615814
188o17.Name = "CharacterSoundEvent"
189o17.Parent = o16
190o18.Name = "Running"
191o18.Parent = o2
192o18.Pitch = 1.8500000238419
193o18.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
194o18.Volume = 0.64999997615814
195o18.Looped = true
196o19.Name = "CharacterSoundEvent"
197o19.Parent = o18
198o20.Name = "Swimming"
199o20.Parent = o2
200o20.Pitch = 1.6000000238419
201o20.SoundId = "rbxasset://sounds/action_swim.mp3"
202o20.Volume = 0.64999997615814
203o20.Looped = true
204o21.Name = "CharacterSoundEvent"
205o21.Parent = o20
206o22.Name = "Climbing"
207o22.Parent = o2
208o22.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
209o22.Volume = 0.64999997615814
210o22.Looped = true
211o23.Name = "CharacterSoundEvent"
212o23.Parent = o22
213o24.Parent = o2
214o24.SoundId = "rbxassetid://531100211"
215o24.Looped = true
216o25.Name = "Jeff_Susto2"
217o25.Parent = o2
218o25.SoundId = "rbxassetid://380102473"
219o25.Volume = 1
220o26.Parent = o2
221o26.SoundId = "rbxassetid://815335430"
222o26.Volume = 1
223o26.Looped = true
224o27.Parent = o2
225o27.Color = Color3.new(1, 0, 0)
226o27.Brightness = 9
227o27.Range = 9
228o28.Parent = o2
229o28.Texture = "http://www.roblox.com/asset/?id=1004502106"
230o29.Name = "HeadWeld"
231o29.Parent = o2
232o29.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
233o29.C1 = CFrame.new(0, 0.649999976, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
234o29.Part0 = o2
235o29.Part1 = o75
236o30.Name = "Torso"
237o30.Parent = o1
238o30.BrickColor = BrickColor.new("Institutional white")
239o30.Position = Vector3.new(12.859992, 3.00000095, -76.3799744)
240o30.FormFactor = Enum.FormFactor.Symmetric
241o30.Size = Vector3.new(2, 2, 1)
242o30.CFrame = CFrame.new(12.859992, 3.00000095, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
243o30.LeftSurface = Enum.SurfaceType.Weld
244o30.RightSurface = Enum.SurfaceType.Weld
245o30.Color = Color3.new(0.972549, 0.972549, 0.972549)
246o30.Position = Vector3.new(12.859992, 3.00000095, -76.3799744)
247o31.Name = "roblox"
248o31.Parent = o30
249o31.Texture = "http://www.roblox.com/asset/?id=1166033059"
250o33.Name = "Right Shoulder"
251o33.Parent = o30
252o33.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
253o33.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
254o33.Part0 = o30
255o33.Part1 = o40
256o33.MaxVelocity = 0.10000000149012
257o34.Name = "Left Shoulder"
258o34.Parent = o30
259o34.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
260o34.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
261o34.Part0 = o30
262o34.Part1 = o38
263o34.MaxVelocity = 0.10000000149012
264o35.Name = "Right Hip"
265o35.Parent = o30
266o35.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
267o35.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
268o35.Part0 = o30
269o35.Part1 = o44
270o35.MaxVelocity = 0.10000000149012
271o36.Name = "Left Hip"
272o36.Parent = o30
273o36.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
274o36.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
275o36.Part0 = o30
276o36.Part1 = o43
277o36.MaxVelocity = 0.10000000149012
278o37.Name = "Neck"
279o37.Parent = o30
280o37.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
281o37.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
282o37.Part0 = o30
283o37.Part1 = o2
284o37.MaxVelocity = 0.10000000149012
285o38.Name = "Left Arm"
286o38.Parent = o1
287o38.BrickColor = BrickColor.new("Institutional white")
288o38.Position = Vector3.new(11.359992, 3.00000095, -76.3799744)
289o38.CanCollide = false
290o38.FormFactor = Enum.FormFactor.Symmetric
291o38.Size = Vector3.new(1, 2, 1)
292o38.CFrame = CFrame.new(11.359992, 3.00000095, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
293o38.Color = Color3.new(0.972549, 0.972549, 0.972549)
294o38.Position = Vector3.new(11.359992, 3.00000095, -76.3799744)
295o39.Name = "LeftGrip"
296o39.Parent = o38
297o39.C0 = CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, 0)
298o39.C1 = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
299o39.Part0 = o38
300o39.Part1 = o38
301o40.Name = "Right Arm"
302o40.Parent = o1
303o40.BrickColor = BrickColor.new("Institutional white")
304o40.Position = Vector3.new(14.359992, 3.00000095, -76.3799744)
305o40.CanCollide = false
306o40.FormFactor = Enum.FormFactor.Symmetric
307o40.Size = Vector3.new(1, 2, 1)
308o40.CFrame = CFrame.new(14.359992, 3.00000095, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
309o40.Color = Color3.new(0.972549, 0.972549, 0.972549)
310o40.Position = Vector3.new(14.359992, 3.00000095, -76.3799744)
311o41.Name = "RightGripWeld"
312o41.Parent = o40
313o41.C0 = CFrame.new(-1.29999995, 1.16840947, 0.750634551, 1, 0, 0, 0, 0.968409479, 0.249365434, 0, -0.249365434, 0.968409479)
314o41.C1 = CFrame.new(-1.5, -0, -0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
315o42.Name = "RightGrip"
316o42.Parent = o40
317o42.C0 = CFrame.new(0, -1, 0, 1, 0, -0, 0, 0, 1, 0, -1, 0)
318o42.C1 = CFrame.new(0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
319o42.Part0 = o40
320o42.Part1 = o105
321o43.Name = "Left Leg"
322o43.Parent = o1
323o43.BrickColor = BrickColor.new("Institutional white")
324o43.Position = Vector3.new(12.359992, 1.00000095, -76.3799744)
325o43.CanCollide = false
326o43.FormFactor = Enum.FormFactor.Symmetric
327o43.Size = Vector3.new(1, 2, 1)
328o43.CFrame = CFrame.new(12.359992, 1.00000095, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
329o43.BottomSurface = Enum.SurfaceType.Smooth
330o43.Color = Color3.new(0.972549, 0.972549, 0.972549)
331o43.Position = Vector3.new(12.359992, 1.00000095, -76.3799744)
332o44.Name = "Right Leg"
333o44.Parent = o1
334o44.BrickColor = BrickColor.new("Institutional white")
335o44.Position = Vector3.new(13.359992, 1.00000095, -76.3799744)
336o44.CanCollide = false
337o44.FormFactor = Enum.FormFactor.Symmetric
338o44.Size = Vector3.new(1, 2, 1)
339o44.CFrame = CFrame.new(13.359992, 1.00000095, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
340o44.BottomSurface = Enum.SurfaceType.Smooth
341o44.Color = Color3.new(0.972549, 0.972549, 0.972549)
342o44.Position = Vector3.new(13.359992, 1.00000095, -76.3799744)
343o45.Name = "ColdBloodedKiller"
344o45.Parent = o1
345o45.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
346o45.HealthDisplayDistance = 0
347o45.NameDisplayDistance = 0
348o45.NameOcclusion = Enum.NameOcclusion.EnemyOcclusion
349o45.RightLeg = o44
350o45.LeftLeg = o43
351o45.Torso = o49
352o45.Health = 500
353o45.MaxHealth = 500
354o46.Name = "Status"
355o46.Parent = o45
356o47.Name = "AvalibleSpawns"
357o47.Parent = o46
358o49.Name = "HumanoidRootPart"
359o49.Parent = o1
360o49.Transparency = 1
361o49.Position = Vector3.new(12.859992, 3.00000095, -76.3799744)
362o49.CanCollide = false
363o49.FormFactor = Enum.FormFactor.Symmetric
364o49.Size = Vector3.new(2, 2, 1)
365o49.CFrame = CFrame.new(12.859992, 3.00000095, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
366o49.BottomSurface = Enum.SurfaceType.Smooth
367o49.TopSurface = Enum.SurfaceType.Smooth
368o49.Position = Vector3.new(12.859992, 3.00000095, -76.3799744)
369o51.Name = "RootJoint"
370o51.Parent = o49
371o51.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
372o51.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
373o51.Part0 = o49
374o51.Part1 = o30
375o51.MaxVelocity = 0.10000000149012
376o52.Name = "Sound"
377o52.Parent = o1
378table.insert(cors,coroutine.create(function()
379wait()
380runDummyScript(function()
381--[[
382 Author: @spotco
383 This script creates sounds which are placed under the character head.
384 These sounds are used by the "LocalSound" script.
385
386 To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
387 The default Sound script loaded for every character will then be replaced with your copy of the script.
388]]--
389local ReplicatedStorage = game:GetService("ReplicatedStorage")
390local Players = game:GetService("Players")
391
392local SOUND_EVENT_FOLDER_NAME = "DefaultSoundEvents"
393local DEFAULT_SERVER_SOUND_EVENT_NAME = "DefaultServerSoundEvent"
394
395local SoundEventFolder = ReplicatedStorage:FindFirstChild(SOUND_EVENT_FOLDER_NAME)
396local DefaultServerSoundEvent = nil
397
398local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
399if useSoundDispatcher then
400 if not SoundEventFolder then
401 SoundEventFolder = Instance.new("Folder")
402 SoundEventFolder.Name = SOUND_EVENT_FOLDER_NAME
403 SoundEventFolder.Archivable = false
404 SoundEventFolder.Parent = ReplicatedStorage
405 end
406
407 DefaultServerSoundEvent = SoundEventFolder:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
408else
409 DefaultServerSoundEvent = ReplicatedStorage:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
410end
411
412if not DefaultServerSoundEvent then
413 if useSoundDispatcher then
414 DefaultServerSoundEvent = Instance.new("RemoteEvent", SoundEventFolder)
415 else
416 DefaultServerSoundEvent = Instance.new("RemoteEvent", ReplicatedStorage)
417 end
418
419 DefaultServerSoundEvent.Name = DEFAULT_SERVER_SOUND_EVENT_NAME
420 DefaultServerSoundEvent.OnServerEvent:Connect(function() end)
421end
422
423local function CreateNewSound(name, id, looped, pitch, parent)
424 local sound = Instance.new("Sound")
425 sound.SoundId = id
426 sound.Name = name
427 sound.archivable = false
428 sound.Pitch = pitch
429 sound.Looped = looped
430 sound.MinDistance = 5
431 sound.MaxDistance = 150
432 sound.Volume = 0.65
433 sound.Parent = parent
434
435 if DefaultServerSoundEvent then
436 local CharacterSoundEvent = Instance.new("RemoteEvent", sound)
437 CharacterSoundEvent.Name = "CharacterSoundEvent"
438 CharacterSoundEvent.OnServerEvent:Connect(function(player, playing, resetPosition)
439 if type(playing) ~= "boolean" then
440 return
441 end
442 if type(resetPosition) ~= "boolean" then
443 return
444 end
445
446 if player.Character ~= script.Parent then
447 return
448 end
449 for _, p in pairs(Players:GetPlayers()) do
450 if p ~= player then
451 -- Connect to the dispatcher to check if the player has loaded.
452 if useSoundDispatcher then
453 SoundEventFolder:FindFirstChild("SoundDispatcher"):Fire(p, sound, playing, resetPosition)
454 else
455 DefaultServerSoundEvent:FireClient(p, sound, playing, resetPosition)
456 end
457 end
458 end
459 end)
460 end
461 return sound
462end
463
464local head = script.Parent:FindFirstChild("Head")
465if not head then
466 error("Sound script parent has no child Head.")
467 return
468end
469
470CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
471CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
472CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
473CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
474CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
475CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
476CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
477CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
478CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
479end,o52)
480end))
481o53.Name = "LocalSound"
482o53.Parent = o52
483table.insert(cors,coroutine.create(function()
484wait()
485runDummyScript(function()
486--[[
487 Author: @spotco
488 This script runs locally for the player of the given humanoid.
489 This script triggers humanoid sound play/pause actions locally.
490
491 The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
492 immediately for the player and is replicated to all other players.
493
494 This script is optimized to reduce network traffic through minimizing the amount of property replication.
495]]--
496
497--All sounds are referenced by this ID
498local SFX = {
499 Died = 0;
500 Running = 1;
501 Swimming = 2;
502 Climbing = 3,
503 Jumping = 4;
504 GettingUp = 5;
505 FreeFalling = 6;
506 FallingDown = 7;
507 Landing = 8;
508 Splash = 9;
509}
510
511local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")
512
513local Humanoid = nil
514local Head = nil
515--SFX ID to Sound object
516local Sounds = {}
517local SoundService = game:GetService("SoundService")
518local soundEventFolderName = "DefaultSoundEvents"
519local ReplicatedStorage = game:GetService("ReplicatedStorage")
520local AddCharacterLoadedEvent = nil
521local RemoveCharacterEvent = nil
522local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
523local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
524
525if useSoundDispatcher then
526 if not soundEventFolder then
527 soundEventFolder = Instance.new("Folder", ReplicatedStorage)
528 soundEventFolder.Name = soundEventFolderName
529 soundEventFolder.Archivable = false
530 end
531
532 -- Load the RemoveCharacterEvent
533 RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
534 if RemoveCharacterEvent == nil then
535 RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
536 RemoveCharacterEvent.Name = "RemoveCharacterEvent"
537 end
538
539 AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
540 if AddCharacterLoadedEvent == nil then
541 AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
542 AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
543 end
544
545 -- Notify the server a new character has been loaded
546 AddCharacterLoadedEvent:FireServer()
547
548 -- Notify the sound dispatcher this character has left.
549 game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
550 RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
551 end)
552end
553
554do
555 local Figure = script.Parent.Parent
556 Head = Figure:WaitForChild("Head")
557 while not Humanoid do
558 for _,NewHumanoid in pairs(Figure:GetChildren()) do
559 if NewHumanoid:IsA("Humanoid") then
560 Humanoid = NewHumanoid
561 break
562 end
563 end
564 if Humanoid then break end
565 Figure.ChildAdded:wait()
566 end
567 Sounds[SFX.Died] = Head:WaitForChild("Died")
568 Sounds[SFX.Running] = Head:WaitForChild("Running")
569 Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
570 Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
571 Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
572 Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
573 Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
574 Sounds[SFX.Landing] = Head:WaitForChild("Landing")
575 Sounds[SFX.Splash] = Head:WaitForChild("Splash")
576
577 local DefaultServerSoundEvent = nil
578 if useSoundDispatcher then
579 DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
580 else
581 DefaultServerSoundEvent = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent")
582 end
583
584 if DefaultServerSoundEvent then
585 DefaultServerSoundEvent.OnClientEvent:connect(function(sound, playing, resetPosition)
586 if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") then
587 if resetPosition and sound.TimePosition ~= 0 then
588 sound.TimePosition = 0
589 end
590 if sound.IsPlaying ~= playing then
591 sound.Playing = playing
592 end
593 else
594 if sound.TimePosition ~= 0 then
595 sound.TimePosition = 0
596 end
597 if not sound.IsPlaying then
598 sound.Playing = true
599 end
600 end
601 end)
602 end
603end
604
605local IsSoundFilteringEnabled = function()
606 return game.Workspace.FilteringEnabled and SoundService.RespectFilteringEnabled
607end
608
609local Util
610Util = {
611
612 --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
613 YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
614 --(y - y1)/(x - x1) = m
615 local m = (pt1y - pt2y) / (pt1x - pt2x)
616 --float b = pt1.y - m * pt1.x;
617 local b = (pt1y - m * pt1x)
618 return m * x + b
619 end;
620
621 --Clamps the value of "val" between the "min" and "max"
622 Clamp = function(val,min,max)
623 return math.min(max,math.max(min,val))
624 end;
625
626 --Gets the horizontal (x,z) velocity magnitude of the given part
627 HorizontalSpeed = function(Head)
628 local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
629 return hVel.magnitude
630 end;
631
632 --Gets the vertical (y) velocity magnitude of the given part
633 VerticalSpeed = function(Head)
634 return math.abs(Head.Velocity.Y)
635 end;
636
637 --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
638 --If these properties are enabled, use them.
639 Play = function(sound)
640 if IsSoundFilteringEnabled() then
641 sound.CharacterSoundEvent:FireServer(true, true)
642 end
643 if sound.TimePosition ~= 0 then
644 sound.TimePosition = 0
645 end
646 if not sound.IsPlaying then
647 sound.Playing = true
648 end
649 end;
650
651 Pause = function(sound)
652 if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
653 sound.CharacterSoundEvent:FireServer(false, false)
654 end
655 if sound.IsPlaying then
656 sound.Playing = false
657 end
658 end;
659
660 Resume = function(sound)
661 if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
662 sound.CharacterSoundEvent:FireServer(true, false)
663 end
664 if not sound.IsPlaying then
665 sound.Playing = true
666 end
667 end;
668
669 Stop = function(sound)
670 if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
671 sound.CharacterSoundEvent:FireServer(false, true)
672 end
673 if sound.IsPlaying then
674 sound.Playing = false
675 end
676 if sound.TimePosition ~= 0 then
677 sound.TimePosition = 0
678 end
679 end;
680}
681
682do
683 -- List of all active Looped sounds
684 local playingLoopedSounds = {}
685
686 -- Last seen Enum.HumanoidStateType
687 local activeState = nil
688
689 local fallSpeed = 0
690
691 -- Verify and set that "sound" is in "playingLoopedSounds".
692 function setSoundInPlayingLoopedSounds(sound)
693 for i=1, #playingLoopedSounds do
694 if playingLoopedSounds[i] == sound then
695 return
696 end
697 end
698 table.insert(playingLoopedSounds,sound)
699 end
700
701 -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
702 function stopPlayingLoopedSoundsExcept(except)
703 for i=#playingLoopedSounds,1,-1 do
704 if playingLoopedSounds[i] ~= except then
705 Util.Pause(playingLoopedSounds[i])
706 table.remove(playingLoopedSounds,i)
707 end
708 end
709 end
710
711 -- Table of Enum.HumanoidStateType to handling function
712 local stateUpdateHandler = {
713 [Enum.HumanoidStateType.Dead] = function()
714 stopPlayingLoopedSoundsExcept()
715 local sound = Sounds[SFX.Died]
716 Util.Play(sound)
717 end;
718
719 [Enum.HumanoidStateType.RunningNoPhysics] = function(speed)
720 stateUpdated(Enum.HumanoidStateType.Running, speed)
721 end;
722
723 [Enum.HumanoidStateType.Running] = function(speed)
724 local sound = Sounds[SFX.Running]
725 stopPlayingLoopedSoundsExcept(sound)
726
727 if(useUpdatedLocalSoundFlag and activeState == Enum.HumanoidStateType.Freefall and fallSpeed > 0.1) then
728 -- Play a landing sound if the character dropped from a large distance
729 local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
730 local freeFallSound = Sounds[SFX.FreeFalling]
731 freeFallSound.Volume = vol
732 Util.Play(freeFallSound)
733 fallSpeed = 0
734 end
735 if useUpdatedLocalSoundFlag then
736 if speed ~= nil and speed > 0.5 then
737 Util.Resume(sound)
738 setSoundInPlayingLoopedSounds(sound)
739 elseif speed ~= nil then
740 stopPlayingLoopedSoundsExcept()
741 end
742 else
743 if Util.HorizontalSpeed(Head) > 0.5 then
744 Util.Resume(sound)
745 setSoundInPlayingLoopedSounds(sound)
746 else
747 stopPlayingLoopedSoundsExcept()
748 end
749 end
750 end;
751
752 [Enum.HumanoidStateType.Swimming] = function(speed)
753 local threshold
754 if useUpdatedLocalSoundFlag then threshold = speed else threshold = Util.VerticalSpeed(Head) end
755 if activeState ~= Enum.HumanoidStateType.Swimming and threshold > 0.1 then
756 local splashSound = Sounds[SFX.Splash]
757 splashSound.Volume = Util.Clamp(
758 Util.YForLineGivenXAndTwoPts(
759 Util.VerticalSpeed(Head),
760 100, 0.28,
761 350, 1),
762 0,1)
763 Util.Play(splashSound)
764 end
765
766 do
767 local sound = Sounds[SFX.Swimming]
768 stopPlayingLoopedSoundsExcept(sound)
769 Util.Resume(sound)
770 setSoundInPlayingLoopedSounds(sound)
771 end
772 end;
773
774 [Enum.HumanoidStateType.Climbing] = function(speed)
775 local sound = Sounds[SFX.Climbing]
776 if useUpdatedLocalSoundFlag then
777 if speed ~= nil and math.abs(speed) > 0.1 then
778 Util.Resume(sound)
779 stopPlayingLoopedSoundsExcept(sound)
780 else
781 Util.Pause(sound)
782 stopPlayingLoopedSoundsExcept(sound)
783 end
784 else
785 if Util.VerticalSpeed(Head) > 0.1 then
786 Util.Resume(sound)
787 stopPlayingLoopedSoundsExcept(sound)
788 else
789 stopPlayingLoopedSoundsExcept()
790 end
791 end
792
793 setSoundInPlayingLoopedSounds(sound)
794 end;
795
796 [Enum.HumanoidStateType.Jumping] = function()
797 if activeState == Enum.HumanoidStateType.Jumping then
798 return
799 end
800 stopPlayingLoopedSoundsExcept()
801 local sound = Sounds[SFX.Jumping]
802 Util.Play(sound)
803 end;
804
805 [Enum.HumanoidStateType.GettingUp] = function()
806 stopPlayingLoopedSoundsExcept()
807 local sound = Sounds[SFX.GettingUp]
808 Util.Play(sound)
809 end;
810
811 [Enum.HumanoidStateType.Freefall] = function()
812 if activeState == Enum.HumanoidStateType.Freefall then
813 return
814 end
815 local sound = Sounds[SFX.FreeFalling]
816 sound.Volume = 0
817 stopPlayingLoopedSoundsExcept()
818
819 fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.y))
820 end;
821
822 [Enum.HumanoidStateType.FallingDown] = function()
823 stopPlayingLoopedSoundsExcept()
824 end;
825
826 [Enum.HumanoidStateType.Landed] = function()
827 stopPlayingLoopedSoundsExcept()
828 if Util.VerticalSpeed(Head) > 75 then
829 local landingSound = Sounds[SFX.Landing]
830 landingSound.Volume = Util.Clamp(
831 Util.YForLineGivenXAndTwoPts(
832 Util.VerticalSpeed(Head),
833 50, 0,
834 100, 1),
835 0,1)
836 Util.Play(landingSound)
837 end
838 end;
839
840 [Enum.HumanoidStateType.Seated] = function()
841 stopPlayingLoopedSoundsExcept()
842 end;
843 }
844
845
846
847 -- Handle state event fired or OnChange fired
848 function stateUpdated(state, speed)
849 if stateUpdateHandler[state] ~= nil then
850 if useUpdatedLocalSoundFlag and (state == Enum.HumanoidStateType.Running
851 or state == Enum.HumanoidStateType.Climbing
852 or state == Enum.HumanoidStateType.Swimming
853 or state == Enum.HumanoidStateType.RunningNoPhysics) then
854 stateUpdateHandler[state](speed)
855 else
856 stateUpdateHandler[state]()
857 end
858 end
859 activeState = state
860 end
861
862 Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
863 Humanoid.Running:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Running, speed) end)
864 Humanoid.Swimming:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Swimming, speed) end)
865 Humanoid.Climbing:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Climbing, speed) end)
866 Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
867 Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
868 Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
869 Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
870
871
872
873 -- required for proper handling of Landed event
874
875 Humanoid.StateChanged:connect(function(old, new)
876 stateUpdated(new)
877 end)
878
879
880
881 function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
882 local stepScale = stepDeltaSeconds / tickSpeedSeconds
883 do
884 local sound = Sounds[SFX.FreeFalling]
885 if activeState == Enum.HumanoidStateType.Freefall then
886 if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
887 Util.Resume(sound)
888
889 --Volume takes 1.1 seconds to go from volume 0 to 1
890 local ANIMATION_LENGTH_SECONDS = 1.1
891
892 local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
893 sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
894 else
895 sound.Volume = 0
896 end
897 else
898 Util.Pause(sound)
899 end
900 end
901
902 do
903 local sound = Sounds[SFX.Running]
904 if activeState == Enum.HumanoidStateType.Running then
905 if Util.HorizontalSpeed(Head) < 0.5 then
906 Util.Pause(sound)
907 end
908 end
909 end
910 end
911
912
913 local lastTick = tick()
914 local TICK_SPEED_SECONDS = 0.25
915 while true do
916 onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
917 lastTick = tick()
918 wait(TICK_SPEED_SECONDS)
919 end
920
921end
922
923end,o53)
924end))
925o54.Name = "Health"
926o54.Parent = o1
927table.insert(cors,coroutine.create(function()
928wait()
929runDummyScript(function()
930-- Gradually regenerates the Humanoid's Health over time.
931
932local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
933local REGEN_STEP = 1 -- Wait this long between each regeneration step.
934
935--------------------------------------------------------------------------------
936
937local Character = script.Parent
938local Humanoid = Character:WaitForChild'Humanoid'
939
940--------------------------------------------------------------------------------
941
942while true do
943 while Humanoid.Health < Humanoid.MaxHealth do
944 local dt = wait(REGEN_STEP)
945 local dh = dt*REGEN_RATE*Humanoid.MaxHealth
946 Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
947 end
948 Humanoid.HealthChanged:Wait()
949end
950end,o54)
951end))
952o56.Name = "Handle"
953o56.Parent = mas
954o56.Position = Vector3.new(12.859992, 4.50000095, -76.9797058)
955o56.CanCollide = false
956o56.FormFactor = Enum.FormFactor.Symmetric
957o56.Size = Vector3.new(1, 1, 1)
958o56.CFrame = CFrame.new(12.859992, 4.50000095, -76.9797058, 1, -7.87137555e-09, 0, 7.87137555e-09, 1, 4.1444221e-16, -3.26223034e-24, -4.1444221e-16, 1)
959o56.BottomSurface = Enum.SurfaceType.Smooth
960o56.TopSurface = Enum.SurfaceType.Smooth
961o56.Position = Vector3.new(12.859992, 4.50000095, -76.9797058)
962o57.Parent = o56
963o57.MeshId = "http://www.roblox.com/asset/?id=13520257"
964o57.Scale = Vector3.new(1.10000002, 1, 1)
965o57.TextureId = "http://www.roblox.com/asset/?id=13520260"
966o57.MeshType = Enum.MeshType.FileMesh
967o59.Name = "OriginalSize"
968o59.Parent = o56
969o59.Value = Vector3.new(1, 1, 1)
970o60.Name = "AccessoryWeld"
971o60.Parent = o56
972o60.C0 = CFrame.new(3.93538357e-09, 0, -0.000272274017, 1, 7.87137555e-09, -3.26223034e-24, -7.87137555e-09, 1, -4.1444221e-16, 0, 4.1444221e-16, 1)
973o60.C1 = CFrame.new(0, 0, -0.600000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
974o60.Part0 = o56
975o60.Part1 = o2
976o61.Parent = o1
977o61.HeadColor = BrickColor.new("Institutional white")
978o61.LeftArmColor = BrickColor.new("Institutional white")
979o61.LeftLegColor = BrickColor.new("Institutional white")
980o61.RightArmColor = BrickColor.new("Institutional white")
981o61.RightLegColor = BrickColor.new("Institutional white")
982o61.TorsoColor = BrickColor.new("Institutional white")
983o63.Name = "Handle"
984o63.Parent = mas
985o63.Position = Vector3.new(12.859992, 4.55000114, -77.1299744)
986o63.CanCollide = false
987o63.FormFactor = Enum.FormFactor.Custom
988o63.Size = Vector3.new(2.31002712, 0.70999819, 1.91000271)
989o63.CFrame = CFrame.new(12.859992, 4.55000114, -77.1299744, 1, -7.87137555e-09, -3.02998127e-15, 7.87137555e-09, 1, 4.14442554e-16, 3.02998127e-15, -4.1444258e-16, 1)
990o63.BottomSurface = Enum.SurfaceType.Smooth
991o63.TopSurface = Enum.SurfaceType.Smooth
992o63.Position = Vector3.new(12.859992, 4.55000114, -77.1299744)
993o64.Parent = o63
994o64.MeshId = "rbxassetid://1241066615"
995o64.TextureId = "rbxassetid://1241066960"
996o64.MeshType = Enum.MeshType.FileMesh
997o66.Name = "OriginalSize"
998o66.Parent = o63
999o66.Value = Vector3.new(2.31002712, 0.70999819, 1.91000271)
1000o67.Name = "AccessoryWeld"
1001o67.Parent = o63
1002o67.C0 = CFrame.new(0, -0.0500000007, 0.75, 1, 7.87137555e-09, 3.02998127e-15, -7.87137555e-09, 1, -4.1444258e-16, -3.02998127e-15, 4.14442554e-16, 1)
1003o67.Part0 = o63
1004o67.Part1 = o2
1005o69.Name = "Pants"
1006o69.Parent = o1
1007o69.PantsTemplate = "http://www.roblox.com/asset/?id=1319012848"
1008o70.Parent = o1
1009o70.Graphic = "http://www.roblox.com/asset/?id=1166033059"
1010o71.Name = "Slinger Left Arm"
1011o71.Parent = o1
1012o71.MeshId = 32331863
1013o71.BodyPart = Enum.BodyPart.LeftArm
1014o72.Name = "Slinger Left Leg"
1015o72.Parent = o1
1016o72.MeshId = 32331927
1017o72.BodyPart = Enum.BodyPart.LeftLeg
1018o73.Name = "Swing"
1019o73.Parent = o1
1020o73.AnimationId = "http://www.roblox.com/Asset?ID=89134792"
1021o75.Name = "Handle"
1022o75.Parent = mas
1023o75.Position = Vector3.new(12.859992, 4.35000086, -76.3799744)
1024o75.CanCollide = false
1025o75.FormFactor = Enum.FormFactor.Symmetric
1026o75.Size = Vector3.new(2, 2, 2)
1027o75.CFrame = CFrame.new(12.859992, 4.35000086, -76.3799744, 1, 0, 0, 0, 1, 0, 0, 0, 1)
1028o75.BottomSurface = Enum.SurfaceType.Smooth
1029o75.TopSurface = Enum.SurfaceType.Smooth
1030o75.Position = Vector3.new(12.859992, 4.35000086, -76.3799744)
1031o76.Parent = o75
1032o76.MeshId = "http://www.roblox.com/asset/?id=15393031"
1033o76.TextureId = "http://www.roblox.com/asset/?id=15393013"
1034o76.MeshType = Enum.MeshType.FileMesh
1035o77.Name = "OriginalSize"
1036o77.Parent = o75
1037o77.Value = Vector3.new(2, 2, 2)
1038o78.Name = "Shirt"
1039o78.Parent = o1
1040o78.ShirtTemplate = "http://www.roblox.com/asset/?id=1187657282"
1041o79.Name = "Slinger Right Arm"
1042o79.Parent = o1
1043o79.MeshId = 32331968
1044o79.BodyPart = Enum.BodyPart.RightArm
1045o80.Name = "Slinger Torso"
1046o80.Parent = o1
1047o80.MeshId = 32332055
1048o80.BodyPart = Enum.BodyPart.Torso
1049o81.Name = "AnimateSauce"
1050o81.Parent = o1
1051table.insert(cors,coroutine.create(function()
1052wait()
1053runDummyScript(function()
1054function waitForChild(parent, childName)
1055local child = parent:findFirstChild(childName)
1056if child then return child end
1057while true do
1058child = parent.ChildAdded:wait()
1059if child.Name==childName then return child end
1060end
1061end
1062local Figure = script.Parent
1063local Torso = waitForChild(Figure, "Torso")
1064local RightShoulder = waitForChild(Torso, "Right Shoulder")
1065local LeftShoulder = waitForChild(Torso, "Left Shoulder")
1066local RightHip = waitForChild(Torso, "Right Hip")
1067local LeftHip = waitForChild(Torso, "Left Hip")
1068local Neck = waitForChild(Torso, "Neck")
1069local Humanoid;
1070for _,Child in pairs(Figure:GetChildren())do
1071if Child and Child.ClassName=="Humanoid"then
1072Humanoid=Child;
1073end;
1074end;
1075local pose = "Standing"
1076local currentAnim = ""
1077local currentAnimInstance = nil
1078local currentAnimTrack = nil
1079local currentAnimKeyframeHandler = nil
1080local currentAnimSpeed = 1.0
1081local animTable = {}
1082local animNames = {
1083idle = {
1084{ id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
1085{ id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
1086},
1087walk = {
1088{ id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
1089},
1090run = {
1091{ id = "http://www.roblox.com/asset/?id=252557606", weight = 20 }
1092},
1093jump = {
1094{ id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
1095},
1096fall = {
1097{ id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
1098},
1099climb = {
1100{ id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
1101},
1102sit = {
1103{ id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
1104},
1105toolnone = {
1106{ id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
1107},
1108toolslash = {
1109{ id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
1110--{ id = "slash.xml", weight = 10 }
1111},
1112toollunge = {
1113{ id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
1114},
1115wave = {
1116{ id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
1117},
1118point = {
1119{ id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
1120},
1121dance1 = {
1122{ id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
1123{ id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
1124{ id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
1125},
1126dance2 = {
1127{ id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
1128{ id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
1129{ id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
1130},
1131dance3 = {
1132{ id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
1133{ id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
1134{ id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
1135},
1136laugh = {
1137{ id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
1138},
1139cheer = {
1140{ id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
1141},
1142}
1143local dances = {"dance1", "dance2", "dance3"}
1144
1145-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
1146local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
1147
1148function configureAnimationSet(name, fileList)
1149if (animTable[name] ~= nil) then
1150for _, connection in pairs(animTable[name].connections) do
1151connection:disconnect()
1152end
1153end
1154animTable[name] = {}
1155animTable[name].count = 0
1156animTable[name].totalWeight = 0
1157animTable[name].connections = {}
1158
1159-- check for config values
1160local config = script:FindFirstChild(name)
1161if (config ~= nil) then
1162--print("Loading anims " .. name)
1163table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
1164table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
1165local idx = 1
1166for _, childPart in pairs(config:GetChildren()) do
1167if (childPart:IsA("Animation")) then
1168table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
1169animTable[name][idx] = {}
1170animTable[name][idx].anim = childPart
1171local weightObject = childPart:FindFirstChild("Weight")
1172if (weightObject == nil) then
1173animTable[name][idx].weight = 1
1174else
1175animTable[name][idx].weight = weightObject.Value
1176end
1177animTable[name].count = animTable[name].count + 1
1178animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
1179--print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
1180idx = idx + 1
1181end
1182end
1183end
1184
1185-- fallback to defaults
1186if (animTable[name].count <= 0) then
1187for idx, anim in pairs(fileList) do
1188animTable[name][idx] = {}
1189animTable[name][idx].anim = Instance.new("Animation")
1190animTable[name][idx].anim.Name = name
1191animTable[name][idx].anim.AnimationId = anim.id
1192animTable[name][idx].weight = anim.weight
1193animTable[name].count = animTable[name].count + 1
1194animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
1195--print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
1196end
1197end
1198end
1199
1200-- Setup animation objects
1201function scriptChildModified(child)
1202local fileList = animNames[child.Name]
1203if (fileList ~= nil) then
1204configureAnimationSet(child.Name, fileList)
1205end
1206end
1207
1208script.ChildAdded:connect(scriptChildModified)
1209script.ChildRemoved:connect(scriptChildModified)
1210
1211
1212for name, fileList in pairs(animNames) do
1213configureAnimationSet(name, fileList)
1214end
1215
1216-- ANIMATION
1217
1218-- declarations
1219local toolAnim = "None"
1220local toolAnimTime = 0
1221
1222local jumpAnimTime = 0
1223local jumpAnimDuration = 0.3
1224
1225local toolTransitionTime = 0.1
1226local fallTransitionTime = 0.3
1227local jumpMaxLimbVelocity = 0.75
1228
1229-- functions
1230
1231function stopAllAnimations()
1232local oldAnim = currentAnim
1233
1234-- return to idle if finishing an emote
1235if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
1236oldAnim = "idle"
1237end
1238
1239currentAnim = ""
1240currentAnimInstance = nil
1241if (currentAnimKeyframeHandler ~= nil) then
1242currentAnimKeyframeHandler:disconnect()
1243end
1244
1245if (currentAnimTrack ~= nil) then
1246currentAnimTrack:Stop()
1247currentAnimTrack:Destroy()
1248currentAnimTrack = nil
1249end
1250return oldAnim
1251end
1252
1253function setAnimationSpeed(speed)
1254if speed ~= currentAnimSpeed then
1255currentAnimSpeed = speed
1256currentAnimTrack:AdjustSpeed(currentAnimSpeed)
1257end
1258end
1259
1260function keyFrameReachedFunc(frameName)
1261if (frameName == "End") then
1262
1263local repeatAnim = currentAnim
1264-- return to idle if finishing an emote
1265if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
1266repeatAnim = "idle"
1267end
1268
1269local animSpeed = currentAnimSpeed
1270playAnimation(repeatAnim, 0.0, Humanoid)
1271setAnimationSpeed(animSpeed)
1272end
1273end
1274
1275-- Preload animations
1276function playAnimation(animName, transitionTime, humanoid)
1277
1278local roll = math.random(1, animTable[animName].totalWeight)
1279local origRoll = roll
1280local idx = 1
1281while (roll > animTable[animName][idx].weight) do
1282roll = roll - animTable[animName][idx].weight
1283idx = idx + 1
1284end
1285--print(animName .. " " .. idx .. " [" .. origRoll .. "]")
1286local anim = animTable[animName][idx].anim
1287-- switch animation
1288if (anim ~= currentAnimInstance) then
1289if (currentAnimTrack ~= nil) then
1290currentAnimTrack:Stop(transitionTime)
1291currentAnimTrack:Destroy()
1292end
1293currentAnimSpeed = 1.0
1294-- load it to the humanoid; get AnimationTrack
1295currentAnimTrack = humanoid:LoadAnimation(anim)
1296-- play the animation
1297currentAnimTrack:Play(transitionTime)
1298currentAnim = animName
1299currentAnimInstance = anim
1300-- set up keyframe name triggers
1301if (currentAnimKeyframeHandler ~= nil) then
1302currentAnimKeyframeHandler:disconnect()
1303end
1304currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
1305end
1306end
1307-------------------------------------------------------------------------------------------
1308-------------------------------------------------------------------------------------------
1309local toolAnimName = ""
1310local toolAnimTrack = nil
1311local toolAnimInstance = nil
1312local currentToolAnimKeyframeHandler = nil
1313function toolKeyFrameReachedFunc(frameName)
1314if (frameName == "End") then
1315--print("Keyframe : ".. frameName)
1316playToolAnimation(toolAnimName, 0.0, Humanoid)
1317end
1318end
1319function playToolAnimation(animName, transitionTime, humanoid)
1320local roll = math.random(1, animTable[animName].totalWeight)
1321local origRoll = roll
1322local idx = 1
1323while (roll > animTable[animName][idx].weight) do
1324roll = roll - animTable[animName][idx].weight
1325idx = idx + 1
1326end
1327--print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
1328local anim = animTable[animName][idx].anim
1329if (toolAnimInstance ~= anim) then
1330if (toolAnimTrack ~= nil) then
1331toolAnimTrack:Stop()
1332toolAnimTrack:Destroy()
1333transitionTime = 0
1334end
1335-- load it to the humanoid; get AnimationTrack
1336toolAnimTrack = humanoid:LoadAnimation(anim)
1337-- play the animation
1338toolAnimTrack:Play(transitionTime)
1339toolAnimName = animName
1340toolAnimInstance = anim
1341currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
1342end
1343end
1344function stopToolAnimations()
1345local oldAnim = toolAnimName
1346if (currentToolAnimKeyframeHandler ~= nil) then
1347currentToolAnimKeyframeHandler:disconnect()
1348end
1349toolAnimName = ""
1350toolAnimInstance = nil
1351if (toolAnimTrack ~= nil) then
1352toolAnimTrack:Stop()
1353toolAnimTrack:Destroy()
1354toolAnimTrack = nil
1355end
1356return oldAnim
1357end
1358-------------------------------------------------------------------------------------------
1359-------------------------------------------------------------------------------------------
1360function onRunning(speed)
1361if speed>0.01 then
1362if Figure and Humanoid and Humanoid.WalkSpeed<17 then
1363playAnimation("walk", 0.1, Humanoid);
1364elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
1365playAnimation("run", 0.1, Humanoid);
1366end;
1367if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
1368setAnimationSpeed(speed / 14.5)
1369end
1370pose = "Running"
1371else
1372playAnimation("idle", 0.1, Humanoid)
1373pose = "Standing"
1374end
1375end
1376function onDied()
1377pose = "Dead"
1378end
1379function onJumping()
1380playAnimation("jump", 0.1, Humanoid)
1381jumpAnimTime = jumpAnimDuration
1382pose = "Jumping"
1383end
1384function onClimbing(speed)
1385playAnimation("climb", 0.1, Humanoid)
1386setAnimationSpeed(speed / 12.0)
1387pose = "Climbing"
1388end
1389function onGettingUp()
1390pose = "GettingUp"
1391end
1392function onFreeFall()
1393if (jumpAnimTime <= 0) then
1394playAnimation("fall", fallTransitionTime, Humanoid)
1395end
1396pose = "FreeFall"
1397end
1398function onFallingDown()
1399pose = "FallingDown"
1400end
1401function onSeated()
1402pose = "Seated"
1403end
1404function onPlatformStanding()
1405pose = "PlatformStanding"
1406end
1407function onSwimming(speed)
1408if speed>0 then
1409pose = "Running"
1410else
1411pose = "Standing"
1412end
1413end
1414
1415function getTool()
1416for _, kid in ipairs(Figure:GetChildren()) do
1417if kid.className == "Tool" then return kid end
1418end
1419return nil
1420end
1421
1422function getToolAnim(tool)
1423for _, c in ipairs(tool:GetChildren()) do
1424if c.Name == "toolanim" and c.className == "StringValue" then
1425return c
1426end
1427end
1428return nil
1429end
1430
1431function animateTool()
1432
1433if (toolAnim == "None") then
1434playToolAnimation("toolnone", toolTransitionTime, Humanoid)
1435return
1436end
1437
1438if (toolAnim == "Slash") then
1439playToolAnimation("toolslash", 0, Humanoid)
1440return
1441end
1442
1443if (toolAnim == "Lunge") then
1444playToolAnimation("toollunge", 0, Humanoid)
1445return
1446end
1447end
1448
1449function moveSit()
1450RightShoulder.MaxVelocity = 0.15
1451LeftShoulder.MaxVelocity = 0.15
1452RightShoulder:SetDesiredAngle(3.14 /2)
1453LeftShoulder:SetDesiredAngle(-3.14 /2)
1454RightHip:SetDesiredAngle(3.14 /2)
1455LeftHip:SetDesiredAngle(-3.14 /2)
1456end
1457
1458local lastTick = 0
1459
1460function move(time)
1461local amplitude = 1
1462local frequency = 1
1463 local deltaTime = time - lastTick
1464 lastTick = time
1465
1466local climbFudge = 0
1467local setAngles = false
1468
1469 if (jumpAnimTime > 0) then
1470 jumpAnimTime = jumpAnimTime - deltaTime
1471 end
1472
1473if (pose == "FreeFall" and jumpAnimTime <= 0) then
1474playAnimation("fall", fallTransitionTime, Humanoid)
1475elseif (pose == "Seated") then
1476playAnimation("sit", 0.5, Humanoid)
1477return
1478elseif (pose == "Running") then
1479if Figure and Humanoid and Humanoid.WalkSpeed<17 then
1480playAnimation("walk", 0.1, Humanoid);
1481elseif Figure and Humanoid and Humanoid.WalkSpeed>17 then
1482playAnimation("run", 0.1, Humanoid);
1483end;
1484elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
1485stopAllAnimations()
1486amplitude = 0.1
1487frequency = 1
1488setAngles = true
1489end
1490if (setAngles) then
1491local desiredAngle = amplitude * math.sin(time * frequency)
1492RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
1493LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
1494RightHip:SetDesiredAngle(-desiredAngle)
1495LeftHip:SetDesiredAngle(-desiredAngle)
1496end
1497-- Tool Animation handling
1498local tool = getTool()
1499if tool and tool:FindFirstChild("Handle") then
1500local animStringValueObject = getToolAnim(tool)
1501if animStringValueObject then
1502toolAnim = animStringValueObject.Value
1503-- message recieved, delete StringValue
1504animStringValueObject.Parent = nil
1505toolAnimTime = time + .3
1506end
1507if time > toolAnimTime then
1508toolAnimTime = 0
1509toolAnim = "None"
1510end
1511animateTool()
1512else
1513stopToolAnimations()
1514toolAnim = "None"
1515toolAnimInstance = nil
1516toolAnimTime = 0
1517end
1518end
1519-- connect events
1520Humanoid.Died:connect(onDied)
1521Humanoid.Running:connect(onRunning)
1522Humanoid.Jumping:connect(onJumping)
1523Humanoid.Climbing:connect(onClimbing)
1524Humanoid.GettingUp:connect(onGettingUp)
1525Humanoid.FreeFalling:connect(onFreeFall)
1526Humanoid.FallingDown:connect(onFallingDown)
1527Humanoid.Seated:connect(onSeated)
1528Humanoid.PlatformStanding:connect(onPlatformStanding)
1529Humanoid.Swimming:connect(onSwimming)
1530local runService = game:GetService("RunService");
1531playAnimation("idle", 0.1, Humanoid)
1532pose = "Standing"
1533while Wait(0)do
1534local _,time=wait(0)
1535move(time)
1536end
1537end,o81)
1538end))
1539o82.Name = "climb"
1540o82.Parent = o81
1541o83.Name = "ClimbAnim"
1542o83.Parent = o82
1543o83.AnimationId = "http://www.roblox.com/asset/?id=180436334"
1544o84.Name = "fall"
1545o84.Parent = o81
1546o85.Name = "FallAnim"
1547o85.Parent = o84
1548o85.AnimationId = "http://www.roblox.com/asset/?id=180436148"
1549o86.Name = "idle"
1550o86.Parent = o81
1551o87.Name = "Animation1"
1552o87.Parent = o86
1553o87.AnimationId = "http://www.roblox.com/asset/?id=180435571"
1554o88.Name = "Weight"
1555o88.Parent = o87
1556o88.Value = 9
1557o89.Name = "Animation2"
1558o89.Parent = o86
1559o89.AnimationId = "http://www.roblox.com/asset/?id=180435792"
1560o90.Name = "Weight"
1561o90.Parent = o89
1562o90.Value = 1
1563o91.Name = "jump"
1564o91.Parent = o81
1565o92.Name = "JumpAnim"
1566o92.Parent = o91
1567o92.AnimationId = "http://www.roblox.com/asset/?id=125750702"
1568o93.Name = "run"
1569o93.Parent = o81
1570o94.Name = "RunAnim"
1571o94.Parent = o93
1572o94.AnimationId = "http://www.roblox.com/asset/?id=252557606"
1573o95.Name = "sit"
1574o95.Parent = o81
1575o96.Name = "SitAnim"
1576o96.Parent = o95
1577o96.AnimationId = "http://www.roblox.com/asset/?id=178130996"
1578o97.Name = "toolnone"
1579o97.Parent = o81
1580o98.Name = "ToolNoneAnim"
1581o98.Parent = o97
1582o98.AnimationId = "http://www.roblox.com/asset/?id=182393478"
1583o99.Name = "walk"
1584o99.Parent = o81
1585o100.Name = "WalkAnim"
1586o100.Parent = o99
1587o100.AnimationId = "http://www.roblox.com/asset/?id=180426354"
1588o101.Name = "Health"
1589o101.Parent = o1
1590table.insert(cors,coroutine.create(function()
1591wait()
1592runDummyScript(function()
1593--Responsible for regening a player's humanoid's health
1594
1595-- declarations
1596local Figure = script.Parent
1597local Head = Figure:WaitForChild("Head")
1598local Humanoid;
1599for _,Child in pairs(Figure:GetChildren())do
1600if Child and Child.ClassName=="Humanoid"then
1601Humanoid=Child;
1602end;
1603end;
1604local regening = false
1605
1606-- regeneration
1607function regenHealth()
1608 if regening then return end
1609 regening = true
1610
1611 while Humanoid.Health < Humanoid.MaxHealth do
1612 local s = wait(1)
1613 local health = Humanoid.Health
1614 if health~=0 and health < Humanoid.MaxHealth then
1615 local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
1616 health = health + newHealthDelta
1617 Humanoid.Health = math.min(health,Humanoid.MaxHealth)
1618 end
1619 end
1620
1621 if Humanoid.Health > Humanoid.MaxHealth then
1622 Humanoid.Health = Humanoid.MaxHealth
1623 end
1624
1625 regening = false
1626end
1627
1628Humanoid.HealthChanged:connect(regenHealth)
1629
1630end,o101)
1631end))
1632o102.Name = "JeffTheKillerMain"
1633o102.Parent = o1
1634table.insert(cors,coroutine.create(function()
1635wait()
1636runDummyScript(function()
1637--[[ By: Brutez. ]]--
1638local JeffTheKillerScript=script;
1639repeat Wait(0)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso");
1640local JeffTheKiller=JeffTheKillerScript.Parent;
1641function raycast(Spos,vec,currentdist)
1642local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
1643if hit2~=nil and pos2 then
1644if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
1645local currentdist=currentdist-(pos2-Spos).magnitude;
1646return raycast(pos2,vec,currentdist);
1647end;
1648end;
1649return hit2,pos2;
1650end;
1651function RayCast(Position,Direction,MaxDistance,IgnoreList)
1652return Game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
1653end;
1654--[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
1655--[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
1656--[[end;]]--
1657local JeffTheKillerHumanoid;
1658for _,Child in pairs(JeffTheKiller:GetChildren())do
1659if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
1660JeffTheKillerHumanoid=Child;
1661end;
1662end;
1663local AttackDebounce=false;
1664local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
1665local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
1666local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
1667local WalkDebounce=false;
1668local Notice=false;
1669local JeffLaughDebounce=false;
1670local MusicDebounce=false;
1671local NoticeDebounce=false;
1672local ChosenMusic;
1673JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
1674local OriginalC0=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0;
1675function FindNearestBae()
1676local NoticeDistance=200;
1677local TargetMain;
1678for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
1679if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then
1680local TargetPart=TargetModel:FindFirstChild("Torso");
1681local FoundHumanoid;
1682for _,Child in pairs(TargetModel:GetChildren())do
1683if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
1684FoundHumanoid=Child;
1685end;
1686end;
1687if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
1688TargetMain=TargetPart;
1689NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
1690local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
1691if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then
1692if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
1693Spawn(function()
1694AttackDebounce=true;
1695local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
1696local SwingChoice=math.random(1,2);
1697local HitChoice=math.random(1,3);
1698SwingAnimation:Play();
1699SwingAnimation:AdjustSpeed(3.5+(math.random()*0.3));
1700if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
1701local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
1702SwingSound.Pitch=1+(math.random()*0.04);
1703SwingSound:Play();
1704end;
1705Wait(0.3);
1706if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
1707FoundHumanoid:TakeDamage(35);
1708if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
1709local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
1710HitSound.Pitch=1+(math.random()*0.04);
1711HitSound:Play(91154909);
1712elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
1713local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
1714HitSound.Pitch=1+(math.random()*0.04);
1715HitSound:Play(91154932);
1716elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
1717local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
1718HitSound.Pitch=1+(math.random()*0.04);
1719HitSound:Play(91154954);
1720end;
1721end;
1722Wait(0.1);
1723AttackDebounce=false;
1724end);
1725end;
1726end;
1727end;
1728end;
1729end;
1730return TargetMain;
1731end;
1732while Wait(0)do
1733local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
1734local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
1735local Jumpable=false;
1736if Blockage then
1737Jumpable=true;
1738if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
1739local BlockageHumanoid;
1740for _,Child in pairs(Blockage.Parent:GetChildren())do
1741if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
1742BlockageHumanoid=Child;
1743end;
1744end;
1745if Blockage and Blockage:IsA("Terrain")then
1746local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
1747local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
1748if CellMaterial==Enum.CellMaterial.Water then
1749Jumpable=false;
1750end;
1751elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
1752Jumpable=false;
1753end;
1754end;
1755if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
1756JeffTheKillerHumanoid.Jump=true;
1757end;
1758end;
1759if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
1760Spawn(function()
1761WalkDebounce=true;
1762local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
1763local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
1764if RayTarget then
1765local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
1766JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
1767JeffTheKillerHeadFootStepClone:Play();
1768JeffTheKillerHeadFootStepClone:Destroy();
1769if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
1770Wait(0.4);
1771elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
1772Wait(0.15);
1773end
1774end;
1775WalkDebounce=false;
1776end);
1777end;
1778local MainTarget=FindNearestBae();
1779local FoundHumanoid;
1780if MainTarget then
1781for _,Child in pairs(MainTarget.Parent:GetChildren())do
1782if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
1783FoundHumanoid=Child;
1784end;
1785end;
1786end;
1787if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
1788JeffTheKillerHumanoid.Jump=true;
1789end;
1790if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
1791if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
1792JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
1793JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
1794end;
1795elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
1796if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
1797if not JeffLaughDebounce then
1798Spawn(function()
1799JeffLaughDebounce=true;
1800repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
1801JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
1802JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
1803JeffLaughDebounce=false;
1804end);
1805end;
1806end;
1807end;
1808if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
1809local MusicChoice=math.random(1,2);
1810if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
1811ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
1812elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
1813ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
1814end;
1815if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
1816ChosenMusic.Volume=0.5;
1817ChosenMusic:Play();
1818end;
1819elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
1820if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
1821if not MusicDebounce then
1822Spawn(function()
1823MusicDebounce=true;
1824repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
1825if ChosenMusic then
1826ChosenMusic.Volume=0;
1827ChosenMusic:Stop();
1828end;
1829ChosenMusic=nil;
1830MusicDebounce=false;
1831end);
1832end;
1833end;
1834end;
1835if not MainTarget and not JeffLaughDebounce then
1836Spawn(function()
1837JeffLaughDebounce=true;
1838repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
1839JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
1840JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
1841JeffLaughDebounce=false;
1842end);
1843end;
1844if not MainTarget and not MusicDebounce then
1845Spawn(function()
1846MusicDebounce=true;
1847repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
1848if ChosenMusic then
1849ChosenMusic.Volume=0;
1850ChosenMusic:Stop();
1851end;
1852ChosenMusic=nil;
1853MusicDebounce=false;
1854end);
1855end;
1856if MainTarget then
1857Notice=true;
1858if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
1859JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play(380102473);
1860NoticeDebounce=true;
1861end
1862if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
1863if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
1864JeffTheKillerHumanoid.WalkSpeed=40;
1865elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
1866JeffTheKillerHumanoid.WalkSpeed=0.004;
1867end;
1868JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
1869local NeckRotation=(JeffTheKiller:FindFirstChild("Torso").Position.Y-MainTarget.Parent:FindFirstChild("Head").Position.Y)/10;
1870if NeckRotation>-1.5 and NeckRotation<1.5 then
1871JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=OriginalC0*CFrame.fromEulerAnglesXYZ(NeckRotation,0,0);
1872end;
1873if NeckRotation<-1.5 then
1874JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,-0.993636549,0.112633869,0,0.112633869,0.993636549);
1875elseif NeckRotation>1.5 then
1876JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.996671617,0.081521146,0,0.081521146,-0.996671617);
1877end;
1878else
1879end;
1880else
1881Notice=false;
1882NoticeDebounce=false;
1883JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0);
1884local RandomWalk=math.random(1,150);
1885if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
1886JeffTheKillerHumanoid.WalkSpeed=12;
1887if RandomWalk==1 then
1888JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
1889end;
1890end;
1891end;
1892if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
1893JeffTheKillerHumanoid.DisplayDistanceType="None";
1894JeffTheKillerHumanoid.HealthDisplayDistance=0;
1895JeffTheKillerHumanoid.Name="ColdBloodedKiller";
1896JeffTheKillerHumanoid.NameDisplayDistance=0;
1897JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
1898JeffTheKillerHumanoid.AutoJumpEnabled=true;
1899JeffTheKillerHumanoid.AutoRotate=true;
1900JeffTheKillerHumanoid.MaxHealth=700;
1901JeffTheKillerHumanoid.JumpPower=60;
1902JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
1903end;
1904if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
1905JeffTheKillerHumanoid.AutoJumpEnabled=true;
1906end;
1907if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
1908JeffTheKillerHumanoid.AutoRotate=true;
1909end;
1910if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
1911JeffTheKillerHumanoid.PlatformStand=false;
1912end;
1913if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
1914JeffTheKillerHumanoid.Sit=false;
1915end;
1916end;
1917--[[ By: Brutez. ]]--
1918end,o102)
1919end))
1920o103.Name = "Respawn"
1921o103.Parent = o1
1922table.insert(cors,coroutine.create(function()
1923wait()
1924runDummyScript(function()
1925--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]--
1926local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
1927local AdvancedRespawnScript=script;
1928repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
1929local JeffTheKiller=AdvancedRespawnScript.Parent;
1930if AdvancedRespawnScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then
1931JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();
1932end;
1933local GameDerbis=Game:GetService("Debris");
1934local JeffTheKillerHumanoid;
1935for _,Child in pairs(JeffTheKiller:GetChildren())do
1936if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
1937JeffTheKillerHumanoid=Child;
1938end;
1939end;
1940local Respawndant=JeffTheKiller:Clone();
1941if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
1942coroutine.resume(coroutine.create(function()
1943if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
1944SpawnModel=Instance.new("Model");
1945SpawnModel.Parent=JeffTheKillerHumanoid.Status;
1946SpawnModel.Name="AvalibleSpawns";
1947else
1948SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
1949end;
1950function FindSpawn(SearchValue)
1951local PartsArchivable=SearchValue:GetChildren();
1952for AreaSearch=1,#PartsArchivable do
1953if PartsArchivable[AreaSearch].className=="SpawnLocation"then
1954local PositionValue=Instance.new("Vector3Value",SpawnModel);
1955PositionValue.Value=PartsArchivable[AreaSearch].Position;
1956PositionValue.Name=PartsArchivable[AreaSearch].Duration;
1957end;
1958FindSpawn(PartsArchivable[AreaSearch]);
1959end;
1960end;
1961FindSpawn(Game:GetService("Workspace"));
1962local SpawnChilden=SpawnModel:GetChildren();
1963if#SpawnChilden>0 then
1964local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
1965local RespawningForceField=Instance.new("ForceField");
1966RespawningForceField.Parent=JeffTheKiller;
1967RespawningForceField.Name="SpawnForceField";
1968GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
1969JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
1970else
1971if JeffTheKiller:FindFirstChild("SpawnForceField")then
1972JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy();
1973end;
1974JeffTheKiller:MoveTo(Vector3.new(0,115,0));
1975end;
1976end));
1977end;
1978function Respawn()
1979Wait(5);
1980Respawndant.Parent=JeffTheKiller.Parent;
1981Respawndant:makeJoints();
1982Respawndant:FindFirstChild("Head"):MakeJoints();
1983Respawndant:FindFirstChild("Torso"):MakeJoints();
1984JeffTheKiller:remove();
1985end;
1986if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then
1987JeffTheKillerHumanoid.Died:connect(Respawn);
1988end;
1989--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]--
1990end,o103)
1991end))
1992o104.Name = "Knife"
1993o104.Parent = o1
1994o104.GripPos = Vector3.new(0, -0.800000012, 0)
1995o104.CanBeDropped = false
1996o105.Name = "Handle"
1997o105.Parent = o104
1998o105.BrickColor = BrickColor.new("Really black")
1999o105.Position = Vector3.new(14.359992, 2.00000095, -77.1799774)
2000o105.Rotation = Vector3.new(-90, 0, 0)
2001o105.CanCollide = false
2002o105.FormFactor = Enum.FormFactor.Custom
2003o105.Size = Vector3.new(0.400000006, 3, 0.800000012)
2004o105.CFrame = CFrame.new(14.359992, 2.00000095, -77.1799774, 1, 0, 0, 0, 0, 1, 0, -1, 0)
2005o105.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
2006o105.Position = Vector3.new(14.359992, 2.00000095, -77.1799774)
2007o106.Parent = o105
2008o106.SoundId = "rbxassetid://153647514"
2009o106.Volume = 1
2010o107.Parent = o105
2011o107.MeshId = "http://www.roblox.com/asset/?id=121944778"
2012o107.TextureId = "http://www.roblox.com/asset/?id=121944805 "
2013o108.Parent = o105
2014o108.Texture = "rbxgameasset://Images/f94bc32398151444678f59982808bc40"
2015o109.Parent = o105
2016o109.Texture = "rbxgameasset://Images/293e8492b85204768accaaa332b9fed8"
2017o110.Parent = o105
2018o110.Texture = "rbxgameasset://Images/293e8492b85204768accaaa332b9fed8 (1)"
2019o111.Parent = o105
2020o111.Texture = "rbxgameasset://Images/91b056cb0d5025d0a11348d19ed53067"
2021o112.Parent = o105
2022o112.SoundId = "http://www/Illuminati-Theme-item?id=191907895"
2023o112.Volume = 1
2024o113.Name = "FirstPersonArms"
2025o113.Parent = o104
2026table.insert(cors,coroutine.create(function()
2027wait()
2028runDummyScript(function()
2029wait(0.2)
2030local player=game.Players.LocalPlayer
2031local camera=workspace.CurrentCamera
2032local tool=script.Parent
2033local char=player.Character
2034local humanoid=char:WaitForChild("Humanoid")
2035SETTINGS={
2036
2037 FIRST_PERSON={
2038 left_arm=true, --if left arm is Enabled
2039 right_arm=true, --If right arm is Enabled
2040 arm_transparency=0, --The transparency of the Arms
2041 arm_color=BrickColor.new("Really black"), --The colo(u)r of the arms, If below is set to true, This will be the BrickColor of the Arms.
2042 change_color=false, --Changes the colo(u)r of the arms, If false, Will set them as the Players arm colo(u)r
2043 add_shirt=true, --If true, add's the Character's shirt to the Arms--
2044 },
2045
2046}
2047
2048function FirstPerson()
2049 if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
2050 return false
2051 else
2052 return true
2053 end
2054end
2055function Start()
2056 anim_arms=Instance.new("Model")
2057 anim_arms.Name="Arms_Model"
2058 local Shirt=player.Character:FindFirstChild("Shirt")
2059 if Shirt then
2060 Shirt:clone().Parent=anim_arms
2061 Instance.new("Humanoid",anim_arms)
2062 end
2063 local r,l = char:FindFirstChild("Right Arm"):clone(), char:FindFirstChild("Left Arm"):clone()
2064 if r and SETTINGS.FIRST_PERSON.right_arm then
2065 r.Transparency=SETTINGS.FIRST_PERSON.arm_transparency
2066 r.Material=Enum.Material.SmoothPlastic
2067 if SETTINGS.FIRST_PERSON.change_color then
2068 r.BrickColor=SETTINGS.FIRST_PERSON.arm_color
2069 end
2070 end
2071 if l and SETTINGS.FIRST_PERSON.left_arm then
2072 l.Transparency=SETTINGS.FIRST_PERSON.arm_transparency
2073 l.Material=Enum.Material.SmoothPlastic
2074 if SETTINGS.FIRST_PERSON.change_color then
2075 l.BrickColor=SETTINGS.FIRST_PERSON.arm_color
2076 end
2077 end
2078 local rw,lw = Instance.new("Weld"),Instance.new("Weld")
2079 if rw and SETTINGS.FIRST_PERSON.right_arm then
2080 rw.Part0=r
2081 rw.Part1=char:FindFirstChild("Right Arm")
2082 rw.Parent=r
2083 r.Parent=anim_arms
2084 end
2085 if lw and SETTINGS.FIRST_PERSON.left_arm then
2086 lw.Part0=l
2087 lw.Part1=char:FindFirstChild("Left Arm")
2088 lw.Parent=l
2089 l.Parent=anim_arms
2090 end
2091 l.CanCollide=false
2092 r.CanCollide=false
2093 if SETTINGS.FIRST_PERSON.right_arm then
2094 if r:FindFirstChild("RightGrip")~=nil then r:FindFirstChild("RightGrip"):Destroy() end
2095 end
2096 if tool.Handle:FindFirstChild("Mesh") ~= nil then tool.Handle.Mesh:Destroy() end
2097 while equipped do
2098 if FirstPerson() then
2099 if anim_arms ~= nil then
2100 anim_arms.Parent=camera
2101 humanoid.CameraOffset = Vector3.new(0, -0.2, -0.5)
2102 end
2103 else
2104 if anim_arms ~= nil then
2105 anim_arms.Parent=nil
2106 humanoid.CameraOffset = Vector3.new(0,0,0)
2107 end
2108 end
2109 wait()
2110 end
2111end
2112function End()
2113 anim_arms:Destroy()
2114 anim_arms=nil
2115 humanoid.CameraOffset = Vector3.new(0,0,0)
2116end
2117
2118tool.Equipped:connect(function ()
2119 equipped=true
2120 Start()
2121end)
2122tool.Unequipped:connect(function ()
2123 equipped=false
2124 End()
2125end)
2126end,o113)
2127end))
2128o114.Name = "Module"
2129o114.Parent = o104
2130table.insert(cors,coroutine.create(function()
2131wait()
2132runDummyScript(function()
2133--Knife Module Script
2134--MatrixComplexity
2135wait(.2)
2136
2137
2138local tool=script.Parent
2139local player=game.Players.LocalPlayer
2140local char=player.Character
2141local humanoid=char:FindFirstChild("Humanoid")
2142local camera=workspace.CurrentCamera
2143local rightC1 = CFrame.new(-0.5, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
2144local leftC1 = CFrame.new(0, 0.7, 0) * CFrame.Angles(0, (math.pi / 2), 0)
2145local mouse=player:GetMouse()
2146local equipping=false
2147local gettingknife=false
2148local laserCharge=false
2149local playcharge=false
2150local justthrown=false
2151local canLaser=false
2152local justattacked=false
2153local thrownkniferotation=0
2154local Damage=110
2155local Attacking=false
2156local handle=nil
2157local WalkSpeeds={16,20}
2158
2159SOUNDS={
2160 throwing={"153647554","153647549"},
2161 laserthrowing={"138499093"},
2162 shouts={"241084057","168209314","131076695"},
2163 striking={"153647529","153647534","153647539","153647540"},
2164 equip="153647514",
2165 wallhit={"153647563","153647564"},
2166 hitplayer={"153647516","153647519","153647522","153647526"},
2167 deaths={"146594640","146457047","146594648"},
2168}
2169
2170SETTINGS={
2171
2172 tool={
2173 mesh_id="http://www.roblox.com/asset/?id=121944778",
2174 mesh_type=Enum.MeshType.FileMesh,
2175 texture_id="http://www.roblox.com/asset/?id=121944805 ",
2176 mesh_offset=Vector3.new(0,0,0),
2177 mesh_scale=.9,
2178 tool_size=Vector3.new(1,1,1),
2179 tool_transparency=0,
2180 tool_color=BrickColor.Black(),
2181 default_tool_size=1,
2182 },
2183
2184}
2185
2186function DamageObject(hit)
2187 local char=hit.Parent
2188 if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" then
2189 local h=char:FindFirstChild("Humanoid")
2190 if h and h.Health > 0 then
2191 h:TakeDamage(Damage)
2192 PlaySound("Hit1",char.Torso)
2193 if h.Health == 0 then
2194 PlaySound("Hit2",char.Torso)
2195 end
2196 end
2197 end
2198end
2199
2200function PlaySound(name,ctorso)
2201 if name=="Throw" then
2202 tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.throwing[math.random(1,#SOUNDS.throwing)]
2203 tool.Handle.Sound:Play()
2204 elseif name=="ThrowLaser" then
2205 tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.laserthrowing[math.random(1,#SOUNDS.laserthrowing)]
2206 tool.Handle.Sound:Play()
2207 elseif name=="Equip" then
2208 tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.equip
2209 tool.Handle.Sound:Play()
2210 elseif name=="Swing" then
2211 tool.Handle.Sound.SoundId = "rbxassetid://" .. SOUNDS.striking[math.random(1,#SOUNDS.striking)]
2212 tool.Handle.Sound:Play()
2213 elseif name=="Hit1" then
2214 local NewSound=tool.Handle.Sound:clone()
2215 NewSound.Parent=ctorso
2216 NewSound.SoundId = "rbxassetid://" .. SOUNDS.hitplayer[math.random(1,#SOUNDS.hitplayer)]
2217 NewSound:Play()
2218 NewSound:Destroy()
2219 elseif name=="Hit2" then
2220 local NewSound=tool.Handle.Sound:clone()
2221 NewSound.Parent=ctorso
2222 NewSound.SoundId = "rbxassetid://" .. SOUNDS.deaths[math.random(1,#SOUNDS.deaths)]
2223 NewSound:Play()
2224 NewSound:Destroy()
2225 elseif name=="Laser" then
2226 local NewSound=tool.Handle.Sound
2227 NewSound.SoundId = "rbxassetid://" .. SOUNDS.shouts[math.random(1,#SOUNDS.shouts)]
2228 NewSound:Play()
2229 end
2230end
2231
2232function Throwtool(dPos)
2233 if not tool.Handle then return end
2234 local throwingHandle = tool.Handle:Clone()
2235 game:GetService("Debris"):AddItem(throwingHandle, 5)
2236 throwingHandle.Transparency=0
2237 throwingHandle.Parent = workspace
2238 if player.Character and player.Character.Humanoid then
2239 throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * 150
2240 if canLaser then
2241 throwingHandle.Velocity = (player.Character.Humanoid.TargetPoint - throwingHandle.CFrame.p).unit * 9999
2242 end
2243 if mouse.Target ~= nil then
2244 if mouse.Target.Parent.Name~="Arms_Model" and mouse.Target.Name~="ThrownKnife" and mouse.Target.Name~="Handle" then
2245 targetpos=player.Character.Humanoid.TargetPoint
2246 else
2247 targetpos=Vector3.new(0,-10 ,0)
2248 end
2249 end
2250 -- set the orientation to the direction it is being thrown in
2251 throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
2252 local floatingForce = Instance.new('BodyForce', throwingHandle)
2253 floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
2254 local spin = Instance.new('BodyAngularVelocity', throwingHandle)
2255 spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
2256 spawnPos=player.Character.PrimaryPart.Position
2257 spawnPos = spawnPos + dPos*5
2258 if canLaser then
2259 local Ray = Ray.new(tool.Handle.CFrame.p,(mouse.Hit.p - tool.Handle.CFrame.p).unit * 999)
2260 local Hit,Position = game.Workspace:FindPartOnRay(Ray,char)
2261 if Hit then
2262 if Hit.Parent:FindFirstChild("Humanoid") then
2263 Hit.Parent.Humanoid:TakeDamage(110)
2264 laserCharge=true
2265 end end
2266 local RayPart = Instance.new("Part",workspace)
2267 RayPart.Name = "RayPart"
2268 RayPart.BrickColor = BrickColor.new("Bright red")
2269 RayPart.Transparency = 0
2270 RayPart.Anchored = true
2271 RayPart.CanCollide = false
2272 RayPart.TopSurface = Enum.SurfaceType.Smooth
2273 RayPart.BottomSurface = Enum.SurfaceType.Smooth
2274 RayPart.formFactor = Enum.FormFactor.Custom
2275 local Distance = (Position-tool.Handle.CFrame.p).magnitude
2276 RayPart.Size = Vector3.new(0.2,0.2,Distance)
2277 RayPart.CFrame = CFrame.new(Position,tool.Handle.CFrame.p) * CFrame.new(0,0,-Distance/2)
2278 game.Debris:addItem(RayPart,.5)
2279 PlaySound("Laser")
2280 end
2281 end
2282 if throwingHandle then
2283 local touchedConn = throwingHandle.Touched:connect(function(hit)
2284 local char=hit.Parent
2285 camera.CameraSubject=humanoid
2286 camera.CameraType=Enum.CameraType.Custom
2287 if char and char~=player.Character and char.Name~="Arms_Model" and hit.Name~="Handle" and hit.Name~="RayPart" then
2288 local h=char:FindFirstChild("Humanoid")
2289 if h and h.Health > 0 then
2290 throwingHandle:Destroy()
2291 laserCharge=true
2292 if hit.Name~="Head" or hit.className=="Hat" then
2293 h:TakeDamage(Damage)
2294 PlaySound("Hit1",char.Torso)
2295 if h.Health == 0 then
2296 PlaySound("Hit2",char.Torso)
2297 end
2298 else
2299 h:TakeDamage(Damage * 2)
2300 print("Headshot!")
2301 char.Head.Transparency=1
2302 char.Head.CanCollide=false
2303 if char.Head:FindFirstChild("face") then char.Head:FindFirstChild("face").Transparency=1 end
2304 for _,v in pairs(char:GetChildren()) do
2305 if v.className=="Hat" then
2306 v:Destroy()
2307 end
2308 end
2309 for i = 1, 7 do
2310 local blood=Instance.new("Part")
2311 blood.FormFactor="Custom"
2312 blood.Size=Vector3.new(1,.2,1)
2313 blood.BrickColor=BrickColor.Red()
2314 blood.TopSurface=0
2315 blood.BottomSurface=0
2316 game:GetService("Debris"):AddItem(blood,5)
2317 blood.Parent=workspace
2318 blood.Position=char.Head.Position + Vector3.new(math.random(0.2,0.8),0,math.random(0.2,0.8))
2319 end
2320 local sound = Instance.new("Sound")
2321 sound.SoundId = "rbxassetid://142347633"
2322 sound.Parent=char.Head
2323 sound.Pitch=1.1
2324 sound:Play()
2325 end
2326 PlaySound("Hit1")
2327 if h.Health == 0 then
2328 PlaySound("Hit2")
2329 end
2330 elseif hit.Name~="Handle" or hit.Name~="IgnoreThrowingKnives" and hit.Parent.Name~="Arms_Model" and hit.Name~="RayPart" and hit.CanCollide==true then
2331 local sound=Instance.new("Sound")
2332 sound.Parent=hit
2333 sound.SoundId = "rbxassetid://" .. SOUNDS.wallhit[math.random(1,#SOUNDS.wallhit)]
2334 sound:Play()
2335 sound:Destroy()
2336 print("Hit Object: " .. hit.Name)
2337 local newknife=tool.Handle:clone()
2338 newknife.Name="ThrownKnife"
2339 newknife.CFrame = CFrame.new(spawnPos, spawnPos + dPos) * CFrame.Angles(math.pi/-2, 0, 0)
2340 newknife.Position = targetpos
2341 throwingHandle:Destroy()
2342 newknife.Anchored=true
2343 newknife.CanCollide=true
2344 newknife.Transparency=0
2345 newknife.Parent=workspace
2346 wait(7)
2347 for i=1,10 do
2348 newknife.Transparency=i*.1
2349 wait()
2350 end
2351 newknife:Destroy()
2352 end
2353 end
2354 end)
2355 end
2356 end
2357 -- must check if it still exists since we waited
2358 if throwingHandle then
2359 throwingHandle.CanCollide = true
2360 end
2361
2362FUNCTIONS={
2363
2364 CHECKFORFIRSTPERSON=function()
2365 if (camera.focus.p - camera.CoordinateFrame.p).magnitude > 1 then
2366 return false
2367 else
2368 return true
2369 end
2370 end,
2371
2372 ANIMS=function(state)
2373 if state then
2374 mouse.Icon="http://www.roblox.com/asset/?id=54019936"
2375 --Start Animation
2376 local mesh=Instance.new("FileMesh")
2377 mesh.MeshId=SETTINGS.tool.mesh_id
2378 mesh.TextureId=SETTINGS.tool.texture_id
2379 mesh.Scale=Vector3.new(SETTINGS.tool.mesh_scale,SETTINGS.tool.mesh_scale,SETTINGS.tool.mesh_scale)
2380 mesh.Parent=tool.Handle
2381 if SETTINGS.tool.mesh_scale==.1 then
2382 tool.GripPos = Vector3.new(0, -0.55, 0)
2383 elseif SETTINGS.tool.mesh_scale==.2 then
2384 tool.GripPos = Vector3.new(0, -0.6, 0)
2385 elseif SETTINGS.tool.mesh_scale==.3 then
2386 tool.GripPos = Vector3.new(0, -0.65, 0)
2387 elseif SETTINGS.tool.mesh_scale==.4 then
2388 tool.GripPos = Vector3.new(0, -0.7, 0)
2389 elseif SETTINGS.tool.mesh_scale==.5 then
2390 tool.GripPos = Vector3.new(0, -0.75, 0)
2391 elseif SETTINGS.tool.mesh_scale==.6 then
2392 tool.GripPos = Vector3.new(0, -0.8, 0)
2393 elseif SETTINGS.tool.mesh_scale==.7 then
2394 tool.GripPos = Vector3.new(0, -0.85, 0)
2395 elseif SETTINGS.tool.mesh_scale==.8 then
2396 tool.GripPos = Vector3.new(0, -0.9, 0)
2397 elseif SETTINGS.tool.mesh_scale==.9 then
2398 tool.GripPos = Vector3.new(0, -0.95, 0)
2399 elseif SETTINGS.tool.mesh_scale==1 then
2400 tool.GripPos = Vector3.new(0, -1, 0)
2401 else
2402 print("Invalid tool size! Set to default: " .. SETTINGS.tool.default_tool_size )
2403 mesh.Scale=Vector3.new(SETTINGS.tool.default_tool_size,SETTINGS.tool.default_tool_size,SETTINGS.tool.default_tool_size)
2404 if SETTINGS.tool.default_tool_size==.1 then
2405 tool.GripPos = Vector3.new(0, -0.55, 0)
2406 elseif SETTINGS.tool.default_tool_size==.2 then
2407 tool.GripPos = Vector3.new(0, -0.6, 0)
2408 elseif SETTINGS.tool.default_tool_size==.3 then
2409 tool.GripPos = Vector3.new(0, -0.65, 0)
2410 elseif SETTINGS.tool.default_tool_size==.4 then
2411 tool.GripPos = Vector3.new(0, -0.7, 0)
2412 elseif SETTINGS.tool.default_tool_size==.5 then
2413 tool.GripPos = Vector3.new(0, -0.75, 0)
2414 elseif SETTINGS.tool.default_tool_size==.6 then
2415 tool.GripPos = Vector3.new(0, -0.8, 0)
2416 elseif SETTINGS.tool.default_tool_size==.7 then
2417 tool.GripPos = Vector3.new(0, -0.85, 0)
2418 elseif SETTINGS.tool.default_tool_size==.8 then
2419 tool.GripPos = Vector3.new(0, -0.9, 0)
2420 elseif SETTINGS.tool.default_tool_size==.9 then
2421 tool.GripPos = Vector3.new(0, -0.95, 0)
2422 elseif SETTINGS.tool.default_tool_size==1 then
2423 tool.GripPos = Vector3.new(0, -1, 0)
2424 else
2425 print("Invalid default size! Un-equipping and removing Knife...")
2426 if humanoid then
2427 humanoid:Unequiptools()
2428 tool:Destroy()
2429 end
2430 end
2431 end
2432 torso=char:FindFirstChild("Torso")
2433 leftarm=torso:FindFirstChild("Left Shoulder")
2434 if leftarm then
2435 leftarm.Parent=nil
2436 newarmweld=Instance.new("Weld")
2437 newarmweld.Name="LeftWeld"
2438 newarmweld.Part0=torso
2439 newarmweld.C0 = CFrame.new(-1.5, 0.7, 0)
2440 newarmweld.C1 = CFrame.new(0, 0.7, 0)
2441 newarmweld.Part1=char:FindFirstChild("Left Arm")
2442 newarmweld.Parent=torso
2443 end
2444 humanoid.WalkSpeed=WalkSpeeds[2]
2445 for i = 1, 15, 3 do
2446 if equipped then
2447 torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
2448 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
2449 end
2450 wait()
2451 end
2452 else
2453 humanoid.WalkSpeed=WalkSpeeds[1]
2454 torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.new(0,-0.2,0)
2455 tool.GripForward = Vector3.new(0,0,-1)
2456 newarmweld:Destroy()
2457 leftarm.Parent=torso
2458 mouse.Icon=""
2459 torso:FindFirstChild("Neck").C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
2460 torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
2461 end
2462 end
2463}
2464
2465tool.Equipped:connect(function ()
2466 equipped=true
2467 PlaySound("Equip")
2468 FUNCTIONS.ANIMS(true)
2469end)
2470tool.Unequipped:connect(function ()
2471 equipped=false
2472 FUNCTIONS.ANIMS(false)
2473end)
2474tool.Handle.Touched:connect(function (hit)
2475 if Attacking then
2476 DamageObject(hit)
2477 end
2478end)
2479tool.Activated:connect(function ()
2480 if Attacking then return end
2481 if not tool.Enabled then return end
2482 justthrown=false
2483 justattacked=false
2484 if not gettingknife and not justthrown and not Attacking then
2485 HeldTime=time()
2486 end
2487 playcharge=true
2488 wait(.15)
2489 while gettingknife do
2490 wait()
2491 end
2492 local speed=1
2493 for i = 1, 15, speed do
2494 if playcharge and equipped and not gettingknife and not justthrown and not Attacking then
2495 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 50)), 0, (-i * (math.pi / 25)))
2496 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
2497 player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0.05, 1, 0, 0, 0, 1, 0, 0, 0, 1) * CFrame.Angles((-i * (math.pi / 150)),0,0)
2498 wait()
2499 end
2500 end
2501 if playcharge then
2502 canLaser=true
2503 end
2504end)
2505tool.Deactivated:connect(function ()
2506 if not tool.Enabled then return end
2507 currTime=time()
2508 playcharge=false
2509 if HeldTime and currTime - HeldTime > 0.2 and
2510 currTime - HeldTime > 0.01 and not justthrown and not gettingknife then
2511 if not Attacking and not justattacked then
2512 print("Throw")
2513 if canLaser then
2514 PlaySound("ThrowLaser")
2515 else
2516 PlaySound("Throw")
2517 end
2518 tool.Handle.Transparency=1
2519 local targetPos = player.Character.Humanoid.TargetPoint
2520 local lookAt = (targetPos - player.Character.PrimaryPart.Position).unit
2521 local switchEvenOddParity = 1
2522 local angle = math.ceil((1-1)/2)*math.pi/12*switchEvenOddParity
2523 Throwtool(CFrame.Angles(0, angle, 0) * lookAt)
2524 wait()
2525 canLaser=false
2526 HeldTime=0
2527 gettingknife=true
2528 mouse.Icon="http://www.roblox.com/asset/?id=54020165"
2529 player.Character["Right Arm"].RightGrip.C1 = CFrame.new(0, -0.800000012, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
2530 for i = 1, 15, .8 do
2531 if equipped then
2532 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
2533 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
2534 wait()
2535 end
2536 end
2537 justthrown=true
2538 tool.Handle.Transparency=0
2539 PlaySound("Equip")
2540 mouse.Icon="http://www.roblox.com/asset/?id=54019936"
2541 tool.GripForward = Vector3.new(0,0,-1)
2542 for i = 1, 15, 1 do
2543 if equipped then
2544 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
2545 wait()
2546 end
2547 end
2548 gettingknife=false
2549 for i = 1, 15, 3 do
2550 if equipped then
2551 torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
2552 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
2553 end
2554 wait()
2555 end
2556 end
2557 else
2558 if not justthrown and not gettingknife then
2559 if Attacking then return end
2560 print("Attack")
2561 HeldTime=0
2562 Attacking=true
2563 justattacked=true
2564 if math.random(1,2)==1 then
2565 for i = 1, 15, 3 do
2566 if equipped and not gettingknife and not justthrown then
2567 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 65)), 0, (-i * (math.pi / 30)))
2568 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0, 0.858912528, 0.165011853, 0.484809607, -0.464581847, 0.649385393, 0.602048457, -0.215483144, -0.742340684, 0.634426773) * CFrame.Angles((-i * (math.pi / 75)),(i * (math.pi / 180)),0)
2569 wait()
2570 end
2571 end
2572 PlaySound("Swing")
2573 for i = 1, 15, 3 do
2574 if equipped and not gettingknife and not justthrown then
2575 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, 0.0719629526, 0.22870943, 0.970831275, -0.981789052, 0.187819958, 0.0285283029, -0.175816804, -0.955204487, 0.238060504) * CFrame.Angles(0, 0, (i * (math.pi / 15)))
2576 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, 0.7, 0, 0.703028679, -0.151466534, 0.694844246, -0.673604906, 0.171488613, 0.718921423, -0.228050426, -0.973472893, 0.0185328126) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
2577 wait()
2578 end
2579 end
2580 for i = 1, 15, 3 do
2581 if equipped and not justthrown and not gettingknife then
2582 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.5, 0.5, 0, -0.071962975, -0.22870943, 0.970831275, 0.981789052, -0.187820047, 0.0285283029, 0.175816894, 0.955204487, 0.238060504) * CFrame.Angles(0, 0, (-i * (math.pi / 30)))
2583 wait()
2584 end
2585 end
2586 for i = 1, 15, 3 do
2587 equipping=true
2588 if equipped and not gettingknife and not justthrown then
2589 torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
2590 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
2591 end
2592 wait()
2593 end
2594 Attacking=false
2595 else
2596 for i = 1, 15, 3 do
2597 if equipped and not gettingknife and not justthrown then
2598 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, 0, 0.195277825, -0.747909963, 0.634426773, 0.482016951, 0.636551082, 0.602048457, -0.854123056, 0.188237742, 0.484809577) * CFrame.Angles((i * (math.pi / 40)),(-i * (math.pi / 45)),(i * (math.pi / 60)))
2599 end
2600 wait()
2601 end
2602 PlaySound("Swing")
2603 for i = 1, 15, 3 do
2604 if equipped and not gettingknife and not justthrown then
2605 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.2, 0.5, -.3, 0.852928281, -0.428775758, 0.29776603, 0.516928136, 0.614185035, -0.596290231, 0.0727913082, 0.662516415, 0.745502114) * CFrame.Angles((-i * (math.pi / 45)),0,0)
2606 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.200000003, 0.7, 0, 0.849384904, 0.16895318, 0.5, -0.48470962, 0.624545038, 0.612372398, -0.208810255, -0.762494743, 0.612372398) * CFrame.Angles((i * (math.pi / 60)),(-i * (math.pi / 180)),(i * (math.pi / 60)))
2607 end
2608 wait()
2609 end
2610 for i = 1, 15, 3 do
2611 if equipped and not gettingknife and not justthrown then
2612 torso:FindFirstChild("Right Shoulder").C1 = CFrame.new(-0.3, 0.5, -0.300000012, 0.852928281, -0.472260833, -0.222447708, 0.516928136, 0.82349503, 0.233754784, 0.0727913082, -0.314365625, 0.946507096) * CFrame.Angles((i * (math.pi / 45)),0,0)
2613 end
2614 wait()
2615 end
2616 for i = 1, 15, 3 do
2617 if equipped and not gettingknife and not justthrown then
2618 torso:FindFirstChild("Right Shoulder").C1 = rightC1 * CFrame.Angles((-i * (math.pi / 90)),(-i * (math.pi / 90)),(i * (math.pi / 210)))
2619 torso:FindFirstChild("LeftWeld").C1 = CFrame.new(-0.2, .7, 0) * CFrame.Angles((-i * (math.pi / 60)),(i * (math.pi / 90)),(-i * (math.pi / 240)))
2620 end
2621 wait()
2622 end
2623 Attacking=false
2624 end
2625 end
2626 end
2627end)
2628
2629mouse.Move:connect(function ()
2630 if equipped and mouse then
2631 if (mouse.Hit.p - mouse.Origin.p).unit.y < 0.25 and (mouse.Hit.p - mouse.Origin.p).unit.y > -0.25 then
2632 torso:FindFirstChild("Right Shoulder").C0 = CFrame.new(.9,.5,0) * CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
2633 torso:FindFirstChild("LeftWeld").C0 = CFrame.new(-1.5,0.5,0) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
2634 torso:FindFirstChild("Neck").C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(-90),0,math.rad(180)) * CFrame.Angles(math.asin(-(mouse.Hit.p - mouse.Origin.p).unit.y), 0, 0)
2635 end
2636 end
2637end)
2638end,o114)
2639end))
2640o115.Parent = o104
2641o116.Name = "Devs"
2642o116.Parent = o115
2643o116.Position = UDim2.new(0.0099999997764826,0,0.89999997615814,0)
2644o116.Size = UDim2.new(0,175,0,20)
2645o116.Text = "Knife Scripted by Cryme Studios"
2646o116.Position = UDim2.new(0.0099999997764826,0,0.89999997615814,0)
2647o116.BackgroundColor3 = Color3.new(0, 0, 0)
2648o116.BorderColor3 = Color3.new(0.027451, 1, 0.482353)
2649o116.BorderSizePixel = 2
2650o116.Font = Enum.Font.SourceSans
2651o116.FontSize = Enum.FontSize.Size14
2652o116.TextColor3 = Color3.new(0.0823529, 1, 0.494118)
2653o116.TextTransparency = 1
2654o117.Name = "Hit1"
2655o117.Parent = o104
2656o117.Pitch = 1.0225422382355
2657o117.SoundId = "rbxassetid://91154909"
2658o117.Volume = 1
2659o118.Name = "Hit2"
2660o118.Parent = o104
2661o118.Pitch = 1.0092434883118
2662o118.SoundId = "rbxassetid://91154932"
2663o118.Volume = 1
2664o119.Name = "Hit3"
2665o119.Parent = o104
2666o119.Pitch = 1.0101846456528
2667o119.SoundId = "rbxassetid://91154954"
2668o119.Volume = 1
2669o120.Name = "Zombie Right Leg"
2670o120.Parent = o1
2671o120.MeshId = 37683227
2672o120.BodyPart = Enum.BodyPart.RightLeg
2673o120.OverlayTextureId = 37687646
2674mas.Parent = workspace
2675mas:MakeJoints()
2676local mas1 = mas:GetChildren()
2677for i=1,#mas1 do
2678 mas1[i].Parent = workspace
2679 ypcall(function() mas1[i]:MakeJoints() end)
2680end
2681mas:Destroy()
2682for i=1,#cors do
2683coroutine.resume(cors[i])
2684end
2685
2686game:GetService("Lighting").Ambient = Color3.new(0, 0, 0)
2687game:GetService("Lighting").Brightness = 1
2688game:GetService("Lighting").ColorShift_Bottom = Color3.new(0, 0, 0)
2689game:GetService("Lighting").ColorShift_Top = Color3.new(0, 0, 0)
2690game:GetService("Lighting").GlobalShadows = true
2691game:GetService("Lighting").OutdoorAmbient = Color3.new(0.5, 0.5, 0.5)
2692game:GetService("Lighting").Outlines = false
2693game:GetService("Lighting").GeographicLatitude = 41.733299255371
2694game:GetService("Lighting").TimeOfDay = "14:00:00"
2695game:GetService("Lighting").FogColor = Color3.new(0.75, 0.75, 0.75)
2696game:GetService("Lighting").FogEnd = 100000
2697game:GetService("Lighting").FogStart = 0