View difference between Paste ID: dfPzdheG and kWmpKY1a
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
3
do
4
	print("FE Compatibility code by Mokiros")
5
	script.Parent = Player.Character
6
7
	--RemoteEvent for communicating
8
	local Event = Instance.new("RemoteEvent")
9
	Event.Name = "UserInput_Event"
10
11
	--Fake event to make stuff like Mouse.KeyDown work
12
	local function fakeEvent()
13
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
14
		t.connect = t.Connect
15
		return t
16
	end
17
18
	--Creating fake input objects with fake variables
19
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
20
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
21
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
22
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
23
	end}
24
	--Merged 2 functions into one by checking amount of arguments
25
	CAS.UnbindAction = CAS.BindAction
26
27
	--This function will trigger the events that have been :Connect()'ed
28
	local function te(self,ev,...)
29
		local t = m[ev]
30
		if t and t._fakeEvent and t.Function then
31
			t.Function(...)
32
		end
33
	end
34
	m.TrigEvent = te
35
	UIS.TrigEvent = te
36
37
	Event.OnServerEvent:Connect(function(plr,io)
38
	    if plr~=Player then return end
39
		if io.isMouse then
40
			m.Target = io.Target
41
			m.Hit = io.Hit
42
		else
43
			local b = io.UserInputState == Enum.UserInputState.Begin
44
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
45
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
46
			end
47
			for _,t in pairs(CAS.Actions) do
48
				for _,k in pairs(t.Keys) do
49
					if k==io.KeyCode then
50
						t.Function(t.Name,io.UserInputState,io)
51
					end
52
				end
53
			end
54
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
55
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
56
	    end
57
	end)
58
	Event.Parent = NLS([==[
59
	local Player = owner
60
	local Event = script:WaitForChild("UserInput_Event")
61
62
	local UIS = game:GetService("UserInputService")
63
	local input = function(io,a)
64
		if a then return end
65
		--Since InputObject is a client-side instance, we create and pass table instead
66
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
67
	end
68
	UIS.InputBegan:Connect(input)
69
	UIS.InputEnded:Connect(input)
70
71
	local Mouse = Player:GetMouse()
72
	local h,t
73
	--Give the server mouse data 30 times every second, but only if the values changed
74
	--If player is not moving their mouse, client won't fire events
75
	while wait(1/30) do
76
		if h~=Mouse.Hit or t~=Mouse.Target then
77
			h,t=Mouse.Hit,Mouse.Target
78
			Event:FireServer({isMouse=true,Target=t,Hit=h})
79
		end
80
	end]==],Player.Character)
81
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
82
end
83
84
85
--Converted with ttyyuu12345's model to script plugin v4
86
function sandbox(var,func)
87
	local env = getfenv(func)
88
	local newenv = setmetatable({},{
89
		__index = function(self,k)
90
			if k=="script" then
91
				return var
92
			else
93
				return env[k]
94
			end
95
		end,
96
	})
97
	setfenv(func,newenv)
98
	return func
99
end
100
print("e - kill-teleport, q - oii hate skids")
101
function swait(num)
102
	if num == 0 or num == nil then
103
		game:service("RunService").Stepped:wait(0)
104
	else
105
		for i = 0, num do
106
			game:service("RunService").Stepped:wait(0)
107
		end
108
	end
109
end
110
EffectModel = Instance.new("Model", cha)
111
Effects = {
112
  Block = {
113
    Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type)
114
      local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
115
      prt.Anchored = true
116
      prt.CFrame = cframe
117
      local msh = CFuncs.Mesh.Create("BlockMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
118
      game:GetService("Debris"):AddItem(prt, 10)
119
      if Type == 1 or Type == nil then
120
        table.insert(Effects, {
121
          prt,
122
          "Block1",
123
          delay,
124
          x3,
125
          y3,
126
          z3,
127
          msh
128
        })
129
      elseif Type == 2 then
130
        table.insert(Effects, {
131
          prt,
132
          "Block2",
133
          delay,
134
          x3,
135
          y3,
136
          z3,
137
          msh
138
        })
139
      else
140
        table.insert(Effects, {
141
          prt,
142
          "Block3",
143
          delay,
144
          x3,
145
          y3,
146
          z3,
147
          msh
148
        })
149
      end
150
    end
151
  },
152
  Sphere = {
153
    Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
154
      local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
155
      prt.Anchored = true
156
      prt.CFrame = cframe
157
      local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
158
      game:GetService("Debris"):AddItem(prt, 10)
159
      table.insert(Effects, {
160
        prt,
161
        "Cylinder",
162
        delay,
163
        x3,
164
        y3,
165
        z3,
166
        msh
167
      })
168
    end
169
  },
170
  Cylinder = {
171
    Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
172
      local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
173
      prt.Anchored = true
174
      prt.CFrame = cframe
175
      local msh = CFuncs.Mesh.Create("CylinderMesh", prt, "", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
176
      game:GetService("Debris"):AddItem(prt, 10)
177
      table.insert(Effects, {
178
        prt,
179
        "Cylinder",
180
        delay,
181
        x3,
182
        y3,
183
        z3,
184
        msh
185
      })
186
    end
187
  },
188
  Wave = {
189
    Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
190
      local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new())
191
      prt.Anchored = true
192
      prt.CFrame = cframe
193
      local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://0", Vector3.new(0, 0, 0), Vector3.new(x1 / 60, y1 / 60, z1 / 60))
194
                    Cso("158037267", tors, 10, 1)
195
        wait(0,35)
196
      game:GetService("Debris"):AddItem(prt, 10)
197
      table.insert(Effects, {
198
        prt,
199
        "Cylinder",
200
        delay,
201
        x3 / 60,
202
        y3 / 60,
203
        z3 / 60,
204
        msh
205
      })
206
    end
207
  },
208
  Ring = {
209
    Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
210
      local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
211
      prt.Anchored = true
212
      prt.CFrame = cframe
213
      local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://3270017", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
214
      game:GetService("Debris"):AddItem(prt, 10)
215
      table.insert(Effects, {
216
        prt,
217
        "Cylinder",
218
        delay,
219
        x3,
220
        y3,
221
        z3,
222
        msh
223
      })
224
    end
225
  },
226
  Break = {
227
    Create = function(brickcolor, cframe, x1, y1, z1)
228
      local prt = CFuncs.Part.Create(EffectModel, "Neon", 0, 0, brickcolor, "Effect", Vector3.new(0.5, 0.5, 0.5))
229
      prt.Anchored = true
230
      prt.CFrame = cframe * CFrame.fromEulerAnglesXYZ(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50))
231
      local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "Sphere", "", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
232
      local num = math.random(10, 50) / 1000
233
      game:GetService("Debris"):AddItem(prt, 10)
234
      table.insert(Effects, {
235
        prt,
236
        "Shatter",
237
        num,
238
        prt.CFrame,
239
        math.random() - math.random(),
240
        0,
241
        math.random(50, 100) / 100
242
      })
243
    end
244
  },
245
Spiral = {
246
    Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
247
      local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
248
      prt.Anchored = true
249
      prt.CFrame = cframe
250
      local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://1051557", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
251
      game:GetService("Debris"):AddItem(prt, 10)
252
      table.insert(Effects, {
253
        prt,
254
        "Cylinder",
255
        delay,
256
        x3,
257
        y3,
258
        z3,
259
        msh
260
      })
261
    end
262
  },
263
Push = {
264
    Create = function(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay)
265
      local prt = CFuncs.Part.Create(EffectModel, "SmoothPlastic", 0, 0, brickcolor, "Effect", Vector3.new())
266
      prt.Anchored = true
267
      prt.CFrame = cframe
268
      local msh = CFuncs.Mesh.Create("SpecialMesh", prt, "FileMesh", "rbxassetid://437347603", Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
269
      game:GetService("Debris"):AddItem(prt, 10)
270
      table.insert(Effects, {
271
        prt,
272
        "Cylinder",
273
        delay,
274
        x3,
275
        y3,
276
        z3,
277
        msh
278
      })
279
    end
280
  }
281
}
282
CFuncs = {
283
    Part = {
284
        Create = function(Parent, Material, Reflectance, Transparency, BColor, Name, Size)
285
            local Part = Create("Part")({
286
                Parent = Parent,
287
                Reflectance = Reflectance,
288
                Transparency = Transparency,
289
                CanCollide = false,
290
                Locked = true,
291
                BrickColor = BrickColor.new(tostring(BColor)),
292
                Name = Name,
293
                Size = Size,
294
                Material = Material
295
            })
296
            RemoveOutlines(Part)
297
            return Part
298
        end
299
    },
300
    Mesh = {
301
        Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
302
            local Msh = Create(Mesh)({
303
                Parent = Part,
304
                Offset = OffSet,
305
                Scale = Scale
306
            })
307
            if Mesh == "SpecialMesh" then
308
                Msh.MeshType = MeshType
309
                Msh.MeshId = MeshId
310
            end
311
            return Msh
312
        end
313
    },
314
    Mesh = {
315
        Create = function(Mesh, Part, MeshType, MeshId, OffSet, Scale)
316
            local Msh = Create(Mesh)({
317
                Parent = Part,
318
                Offset = OffSet,
319
                Scale = Scale
320
            })
321
            if Mesh == "SpecialMesh" then
322
                Msh.MeshType = MeshType
323
                Msh.MeshId = MeshId
324
            end
325
            return Msh
326
        end
327
    },
328
    Weld = {
329
        Create = function(Parent, Part0, Part1, C0, C1)
330
            local Weld = Create("Weld")({
331
                Parent = Parent,
332
                Part0 = Part0,
333
                Part1 = Part1,
334
                C0 = C0,
335
                C1 = C1
336
            })
337
            return Weld
338
        end
339
    },
340
    Sound = {
341
        Create = function(id, par, vol, pit)
342
            coroutine.resume(coroutine.create(function()
343
                local S = Create("Sound")({
344
                    Volume = vol,
345
                    Pitch = pit or 1,
346
                    SoundId = id,
347
                    Parent = par or workspace
348
                })
349
                wait()
350
                S:play()
351
                game:GetService("Debris"):AddItem(S, 6)
352
            end))
353
        end
354
    },
355
    ParticleEmitter = {
356
        Create = function(Parent, Color1, Color2, LightEmission, Size, Texture, Transparency, ZOffset, Accel, Drag, LockedToPart, VelocityInheritance, EmissionDirection, Enabled, LifeTime, Rate, Rotation, RotSpeed, Speed, VelocitySpread)
357
            local fp = Create("ParticleEmitter")({
358
                Parent = Parent,
359
                Color = ColorSequence.new(Color1, Color2),
360
                LightEmission = LightEmission,
361
                Size = Size,
362
                Texture = Texture,
363
                Transparency = Transparency,
364
                ZOffset = ZOffset,
365
                Acceleration = Accel,
366
                Drag = Drag,
367
                LockedToPart = LockedToPart,
368
                VelocityInheritance = VelocityInheritance,
369
                EmissionDirection = EmissionDirection,
370
                Enabled = Enabled,
371
                Lifetime = LifeTime,
372
                Rate = Rate,
373
                Rotation = Rotation,
374
                RotSpeed = RotSpeed,
375
                Speed = Speed,
376
                VelocitySpread = VelocitySpread
377
            })
378
            return fp
379
        end
380
    }
381
}
382
function Cso(ID, PARENT, VOLUME, PITCH)
383
    local NSound = nil
384
    coroutine.resume(coroutine.create(function()
385
        NSound = IT("Sound", PARENT)
386
        NSound.Volume = VOLUME
387
        NSound.Pitch = PITCH
388
        NSound.SoundId = "http://www.roblox.com/asset/?id="..ID
389
        swait()
390
        NSound:play()
391
        game:GetService("Debris"):AddItem(NSound, 50)
392
    end))
393
    return NSound
394
end
395
function chafunc(text, color)
396
local char = owner.Character
397
	local chat = coroutine.wrap(function()
398
		if char:FindFirstChild("TalkingBillBoard") ~= nil then
399
			char:FindFirstChild("TalkingBillBoard"):destroy()
400
		end
401
		local naeeym2 = Instance.new("BillboardGui", char)
402
		naeeym2.Size = UDim2.new(0, 100, 0, 40)
403
		naeeym2.StudsOffset = Vector3.new(0, 3, 0)
404
		naeeym2.Adornee = hed
405
		naeeym2.Name = "TalkingBillBoard"
406
		local tecks2 = Instance.new("TextLabel", naeeym2)
407
		tecks2.BackgroundTransparency = 1
408
		tecks2.BorderSizePixel = 0
409
		tecks2.Text = ""
410
		tecks2.Font = "Fantasy"
411
		tecks2.TextSize = 30
412
		tecks2.TextStrokeTransparency = 0
413
		tecks2.TextColor3 = color
414
		tecks2.TextStrokeColor3 = Color3.new(232, 186, 200)
415
		tecks2.Size = UDim2.new(1, 0, 0.5, 0)
416
		local tecks3 = Instance.new("TextLabel", naeeym2)
417
		tecks3.BackgroundTransparency = 1
418
		tecks3.BorderSizePixel = 0
419
		tecks3.Text = ""
420
		tecks3.Font = "Fantasy"
421
		tecks3.TextSize = 30
422
		tecks3.TextStrokeTransparency = 0
423
		tecks3.TextColor3 = Color3.new(0, 0, 0)
424
		tecks3.TextStrokeColor3 = color
425
		tecks3.Size = UDim2.new(1, 0, 0.5, 0)
426
		coroutine.resume(coroutine.create(function()
427
			while true do
428
				swait(1)
429
				tecks2.Position = UDim2.new(0, math.random(-5, 5), 0, math.random(-5, 5))
430
				tecks3.Position = UDim2.new(0, math.random(-5, 5), 0, math.random(-5, 5))
431
				tecks2.Rotation = math.random(-5, 5)
432
				tecks3.Rotation = math.random(-5, 5)
433
			end
434
		end))
435
		for i = 1, string.len(text) do
436
			tecks2.Text = string.sub(text, 1, i)
437
			tecks3.Text = string.sub(text, 1, i)
438
			swait(1)
439
		end
440
		wait(1)
441
		local randomrot = math.random(1, 2)
442
		if randomrot == 1 then
443
			for i = 1, 50 do
444
				swait()
445
				tecks2.Rotation = tecks2.Rotation - 0.75
446
				tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
447
				tecks2.TextTransparency = tecks2.TextTransparency + 0.04
448
				tecks3.Rotation = tecks2.Rotation + 0.75
449
				tecks3.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
450
				tecks3.TextTransparency = tecks2.TextTransparency + 0.04
451
			end
452
		elseif randomrot == 2 then
453
			for i = 1, 50 do
454
				swait()
455
				tecks2.Rotation = tecks2.Rotation + 0.75
456
				tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
457
				tecks2.TextTransparency = tecks2.TextTransparency + 0.04
458
				tecks3.Rotation = tecks2.Rotation - 0.75
459
				tecks3.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
460
				tecks3.TextTransparency = tecks2.TextTransparency + 0.04
461
			end
462
		end
463
		naeeym2:Destroy()
464
	end)
465
	chat()
466
end
467
468
cors = {}
469
mas = Instance.new("Model",game:GetService("Lighting"))
470
Model0 = Instance.new("Model")
471
Part1 = Instance.new("Part")
472
Decal2 = Instance.new("Decal")
473
Sound3 = Instance.new("Sound")
474
Sound4 = Instance.new("Sound")
475
Sound5 = Instance.new("Sound")
476
Sound6 = Instance.new("Sound")
477
Sound7 = Instance.new("Sound")
478
Sound8 = Instance.new("Sound")
479
Sound9 = Instance.new("Sound")
480
Sound10 = Instance.new("Sound")
481
Sound11 = Instance.new("Sound")
482
CylinderMesh12 = Instance.new("CylinderMesh")
483
Part13 = Instance.new("Part")
484
Decal14 = Instance.new("Decal")
485
Motor6D15 = Instance.new("Motor6D")
486
Motor6D16 = Instance.new("Motor6D")
487
Motor6D17 = Instance.new("Motor6D")
488
Motor6D18 = Instance.new("Motor6D")
489
Motor6D19 = Instance.new("Motor6D")
490
Part20 = Instance.new("Part")
491
Part21 = Instance.new("Part")
492
Part22 = Instance.new("Part")
493
Part23 = Instance.new("Part")
494
Humanoid24 = Instance.new("Humanoid")
495
Part25 = Instance.new("Part")
496
Motor6D26 = Instance.new("Motor6D")
497
Script27 = Instance.new("Script")
498
LocalScript28 = Instance.new("LocalScript")
499
LocalScript29 = Instance.new("LocalScript")
500
StringValue30 = Instance.new("StringValue")
501
Animation31 = Instance.new("Animation")
502
NumberValue32 = Instance.new("NumberValue")
503
Animation33 = Instance.new("Animation")
504
NumberValue34 = Instance.new("NumberValue")
505
StringValue35 = Instance.new("StringValue")
506
Animation36 = Instance.new("Animation")
507
StringValue37 = Instance.new("StringValue")
508
Animation38 = Instance.new("Animation")
509
StringValue39 = Instance.new("StringValue")
510
Animation40 = Instance.new("Animation")
511
StringValue41 = Instance.new("StringValue")
512
Animation42 = Instance.new("Animation")
513
StringValue43 = Instance.new("StringValue")
514
Animation44 = Instance.new("Animation")
515
StringValue45 = Instance.new("StringValue")
516
Animation46 = Instance.new("Animation")
517
StringValue47 = Instance.new("StringValue")
518
Animation48 = Instance.new("Animation")
519
Script49 = Instance.new("Script")
520
BodyColors50 = Instance.new("BodyColors")
521
Model0.Name = "oii"
522
Model0.Parent = mas
523
Part1.Name = "Head"
524
Part1.Parent = Model0
525
Part1.CFrame = CFrame.new(13.7936363, 4.50001431, -22.1235237, 0.993757904, 0, -0.111558832, 0, 1, 0, 0.111558832, 0, 0.993757904)
526
Part1.Orientation = Vector3.new(0, -6.40999985, 0)
527
Part1.Position = Vector3.new(13.7936363, 4.50001431, -22.1235237)
528
Part1.Rotation = Vector3.new(0, -6.40999985, 0)
529
Part1.Color = Color3.new(0.803922, 0, 0)
530
Part1.Velocity = Vector3.new(5.33474325e-42, 0, -4.77520478e-41)
531
Part1.Size = Vector3.new(2, 1, 1)
532
Part1.BrickColor = BrickColor.new("Really red")
533
Part1.Locked = true
534
Part1.TopSurface = Enum.SurfaceType.Smooth
535
Part1.brickColor = BrickColor.new("Really red")
536
Part1.FormFactor = Enum.FormFactor.Symmetric
537
Part1.formFactor = Enum.FormFactor.Symmetric
538
Decal2.Name = "face"
539
Decal2.Parent = Part1
540
Decal2.Texture = "rbxasset://textures/face.png"
541
Sound3.Name = "GettingUp"
542
Sound3.Parent = Part1
543
Sound3.MaxDistance = 150
544
Sound3.EmitterSize = 5
545
Sound3.MinDistance = 5
546
Sound3.SoundId = "rbxasset://sounds/action_get_up.mp3"
547
Sound3.Volume = 0.64999997615814
548
Sound4.Name = "Died"
549
Sound4.Parent = Part1
550
Sound4.MaxDistance = 150
551
Sound4.EmitterSize = 5
552
Sound4.MinDistance = 5
553
Sound4.SoundId = "rbxasset://sounds/uuhhh.mp3"
554
Sound4.Volume = 0.64999997615814
555
Sound5.Name = "FreeFalling"
556
Sound5.Parent = Part1
557
Sound5.Looped = true
558
Sound5.TimePosition = 0.52838909903676
559
Sound5.MaxDistance = 150
560
Sound5.EmitterSize = 5
561
Sound5.MinDistance = 5
562
Sound5.SoundId = "rbxasset://sounds/action_falling.mp3"
563
Sound5.Volume = 0
564
Sound6.Name = "Jumping"
565
Sound6.Parent = Part1
566
Sound6.MaxDistance = 150
567
Sound6.EmitterSize = 5
568
Sound6.MinDistance = 5
569
Sound6.SoundId = "rbxasset://sounds/action_jump.mp3"
570
Sound6.Volume = 0.64999997615814
571
Sound7.Name = "Landing"
572
Sound7.Parent = Part1
573
Sound7.MaxDistance = 150
574
Sound7.EmitterSize = 5
575
Sound7.MinDistance = 5
576
Sound7.SoundId = "rbxasset://sounds/action_jump_land.mp3"
577
Sound7.Volume = 1
578
Sound8.Name = "Splash"
579
Sound8.Parent = Part1
580
Sound8.MaxDistance = 150
581
Sound8.EmitterSize = 5
582
Sound8.MinDistance = 5
583
Sound8.SoundId = "rbxasset://sounds/impact_water.mp3"
584
Sound8.Volume = 0.64999997615814
585
Sound9.Name = "Running"
586
Sound9.Parent = Part1
587
Sound9.Looped = true
588
Sound9.TimePosition = 1.7229757305085
589
Sound9.MaxDistance = 150
590
Sound9.EmitterSize = 5
591
Sound9.MinDistance = 5
592
Sound9.Pitch = 1.8500000238419
593
Sound9.PlaybackSpeed = 1.8500000238419
594
Sound9.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
595
Sound9.Volume = 0.64999997615814
596
Sound10.Name = "Swimming"
597
Sound10.Parent = Part1
598
Sound10.Looped = true
599
Sound10.MaxDistance = 150
600
Sound10.EmitterSize = 5
601
Sound10.MinDistance = 5
602
Sound10.Pitch = 1.6000000238419
603
Sound10.PlaybackSpeed = 1.6000000238419
604
Sound10.SoundId = "rbxasset://sounds/action_swim.mp3"
605
Sound10.Volume = 0.64999997615814
606
Sound11.Name = "Climbing"
607
Sound11.Parent = Part1
608
Sound11.Looped = true
609
Sound11.MaxDistance = 150
610
Sound11.EmitterSize = 5
611
Sound11.MinDistance = 5
612
Sound11.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
613
Sound11.Volume = 0.64999997615814
614
CylinderMesh12.Parent = Part1
615
CylinderMesh12.Scale = Vector3.new(1.29999995, 1.29999995, 1.29999995)
616
Part13.Name = "Torso"
617
Part13.Parent = Model0
618
Part13.CFrame = CFrame.new(13.7936363, 3.00001407, -22.1235237, 0.993757904, 0, -0.111558832, 0, 1, 0, 0.111558832, 0, 0.993757904)
619
Part13.Orientation = Vector3.new(0, -6.40999985, 0)
620
Part13.Position = Vector3.new(13.7936363, 3.00001407, -22.1235237)
621
Part13.Rotation = Vector3.new(0, -6.40999985, 0)
622
Part13.Color = Color3.new(1, 1, 0)
623
Part13.Velocity = Vector3.new(5.33474325e-42, 0, -4.77520478e-41)
624
Part13.Size = Vector3.new(2, 2, 1)
625
Part13.BrickColor = BrickColor.new("New Yeller")
626
Part13.LeftParamA = 0
627
Part13.LeftParamB = 0
628
Part13.LeftSurface = Enum.SurfaceType.Weld
629
Part13.Locked = true
630
Part13.RightParamA = 0
631
Part13.RightParamB = 0
632
Part13.RightSurface = Enum.SurfaceType.Weld
633
Part13.brickColor = BrickColor.new("New Yeller")
634
Part13.FormFactor = Enum.FormFactor.Symmetric
635
Part13.formFactor = Enum.FormFactor.Symmetric
636
Decal14.Name = "roblox"
637
Decal14.Parent = Part13
638
Motor6D15.Name = "Right Shoulder"
639
Motor6D15.Parent = Part13
640
Motor6D15.MaxVelocity = 0.10000000149012
641
Motor6D15.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
642
Motor6D15.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
643
Motor6D15.Part0 = Part13
644
Motor6D15.Part1 = Part21
645
Motor6D15.part1 = Part21
646
Motor6D16.Name = "Left Shoulder"
647
Motor6D16.Parent = Part13
648
Motor6D16.MaxVelocity = 0.10000000149012
649
Motor6D16.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
650
Motor6D16.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
651
Motor6D16.Part0 = Part13
652
Motor6D16.Part1 = Part20
653
Motor6D16.part1 = Part20
654
Motor6D17.Name = "Right Hip"
655
Motor6D17.Parent = Part13
656
Motor6D17.MaxVelocity = 0.10000000149012
657
Motor6D17.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
658
Motor6D17.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
659
Motor6D17.Part0 = Part13
660
Motor6D17.Part1 = Part23
661
Motor6D17.part1 = Part23
662
Motor6D18.Name = "Left Hip"
663
Motor6D18.Parent = Part13
664
Motor6D18.MaxVelocity = 0.10000000149012
665
Motor6D18.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
666
Motor6D18.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
667
Motor6D18.Part0 = Part13
668
Motor6D18.Part1 = Part22
669
Motor6D18.part1 = Part22
670
Motor6D19.Name = "Neck"
671
Motor6D19.Parent = Part13
672
Motor6D19.MaxVelocity = 0.10000000149012
673
Motor6D19.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
674
Motor6D19.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
675
Motor6D19.Part0 = Part13
676
Motor6D19.Part1 = Part1
677
Motor6D19.part1 = Part1
678
Part20.Name = "Left Arm"
679
Part20.Parent = Model0
680
Part20.CFrame = CFrame.new(12.3029995, 3.00001407, -22.2908611, 0.993757904, 0, -0.111558832, 0, 1, 0, 0.111558832, 0, 0.993757904)
681
Part20.Orientation = Vector3.new(0, -6.40999985, 0)
682
Part20.Position = Vector3.new(12.3029995, 3.00001407, -22.2908611)
683
Part20.Rotation = Vector3.new(0, -6.40999985, 0)
684
Part20.Color = Color3.new(0.803922, 0, 0)
685
Part20.Velocity = Vector3.new(5.33474325e-42, 0, -4.77520478e-41)
686
Part20.Size = Vector3.new(1, 2, 1)
687
Part20.BrickColor = BrickColor.new("Really red")
688
Part20.CanCollide = false
689
Part20.Locked = true
690
Part20.brickColor = BrickColor.new("Really red")
691
Part20.FormFactor = Enum.FormFactor.Symmetric
692
Part20.formFactor = Enum.FormFactor.Symmetric
693
Part21.Name = "Right Arm"
694
Part21.Parent = Model0
695
Part21.CFrame = CFrame.new(15.2842731, 3.00001407, -21.9561863, 0.993757904, 0, -0.111558832, 0, 1, 0, 0.111558832, 0, 0.993757904)
696
Part21.Orientation = Vector3.new(0, -6.40999985, 0)
697
Part21.Position = Vector3.new(15.2842731, 3.00001407, -21.9561863)
698
Part21.Rotation = Vector3.new(0, -6.40999985, 0)
699
Part21.Color = Color3.new(0.803922, 0, 0)
700
Part21.Velocity = Vector3.new(5.33474325e-42, 0, -4.77520478e-41)
701
Part21.Size = Vector3.new(1, 2, 1)
702
Part21.BrickColor = BrickColor.new("Really red")
703
Part21.CanCollide = false
704
Part21.Locked = true
705
Part21.brickColor = BrickColor.new("Really red")
706
Part21.FormFactor = Enum.FormFactor.Symmetric
707
Part21.formFactor = Enum.FormFactor.Symmetric
708
Part22.Name = "Left Leg"
709
Part22.Parent = Model0
710
Part22.CFrame = CFrame.new(13.2967577, 1.00001407, -22.1793022, 0.993757904, 0, -0.111558832, 0, 1, 0, 0.111558832, 0, 0.993757904)
711
Part22.Orientation = Vector3.new(0, -6.40999985, 0)
712
Part22.Position = Vector3.new(13.2967577, 1.00001407, -22.1793022)
713
Part22.Rotation = Vector3.new(0, -6.40999985, 0)
714
Part22.Color = Color3.new(1, 1, 0)
715
Part22.Velocity = Vector3.new(5.33474325e-42, 0, -4.77520478e-41)
716
Part22.Size = Vector3.new(1, 2, 1)
717
Part22.BottomSurface = Enum.SurfaceType.Smooth
718
Part22.BrickColor = BrickColor.new("New Yeller")
719
Part22.CanCollide = false
720
Part22.Locked = true
721
Part22.brickColor = BrickColor.new("New Yeller")
722
Part22.FormFactor = Enum.FormFactor.Symmetric
723
Part22.formFactor = Enum.FormFactor.Symmetric
724
Part23.Name = "Right Leg"
725
Part23.Parent = Model0
726
Part23.CFrame = CFrame.new(14.2905149, 1.00001407, -22.0677452, 0.993757904, 0, -0.111558832, 0, 1, 0, 0.111558832, 0, 0.993757904)
727
Part23.Orientation = Vector3.new(0, -6.40999985, 0)
728
Part23.Position = Vector3.new(14.2905149, 1.00001407, -22.0677452)
729
Part23.Rotation = Vector3.new(0, -6.40999985, 0)
730
Part23.Color = Color3.new(1, 1, 0)
731
Part23.Velocity = Vector3.new(5.33474325e-42, 0, -4.77520478e-41)
732
Part23.Size = Vector3.new(1, 2, 1)
733
Part23.BottomSurface = Enum.SurfaceType.Smooth
734
Part23.BrickColor = BrickColor.new("New Yeller")
735
Part23.CanCollide = false
736
Part23.Locked = true
737
Part23.brickColor = BrickColor.new("New Yeller")
738
Part23.FormFactor = Enum.FormFactor.Symmetric
739
Part23.formFactor = Enum.FormFactor.Symmetric
740
Humanoid24.Parent = Model0
741
Humanoid24.LeftLeg = Part22
742
Humanoid24.RightLeg = Part23
743
Humanoid24.Torso = Part25
744
Part25.Name = "HumanoidRootPart"
745
Part25.Parent = Model0
746
Part25.CFrame = CFrame.new(13.7936363, 3.00001407, -22.1235237, 0.993757904, 0, -0.111558832, 0, 1, 0, 0.111558832, 0, 0.993757904)
747
Part25.Orientation = Vector3.new(0, -6.40999985, 0)
748
Part25.Position = Vector3.new(13.7936363, 3.00001407, -22.1235237)
749
Part25.Rotation = Vector3.new(0, -6.40999985, 0)
750
Part25.Transparency = 1
751
Part25.Velocity = Vector3.new(5.33474325e-42, 0, -4.77520478e-41)
752
Part25.Size = Vector3.new(2, 2, 1)
753
Part25.BottomSurface = Enum.SurfaceType.Smooth
754
Part25.CanCollide = false
755
Part25.LeftParamA = 0
756
Part25.LeftParamB = 0
757
Part25.Locked = true
758
Part25.RightParamA = 0
759
Part25.RightParamB = 0
760
Part25.TopSurface = Enum.SurfaceType.Smooth
761
Part25.FormFactor = Enum.FormFactor.Symmetric
762
Part25.formFactor = Enum.FormFactor.Symmetric
763
Motor6D26.Name = "RootJoint"
764
Motor6D26.Parent = Part25
765
Motor6D26.MaxVelocity = 0.10000000149012
766
Motor6D26.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
767
Motor6D26.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
768
Motor6D26.Part0 = Part25
769
Motor6D26.Part1 = Part13
770
Motor6D26.part1 = Part13
771
Script27.Name = "Sound"
772
Script27.Parent = Model0
773
table.insert(cors,sandbox(Script27,function()
774
--[[
775
	Author: @spotco
776
	This script creates sounds which are placed under the character head.
777
	These sounds are used by the "LocalSound" script.
778
	
779
	To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
780
	The default Sound script loaded for every character will then be replaced with your copy of the script.
781
]]--
782
783
function CreateNewSound(name, id, looped, pitch, parent)
784
	local sound = Instance.new("Sound")
785
	sound.SoundId = id
786
	sound.Name = name
787
	sound.archivable = false
788
	sound.Parent = parent
789
	sound.Pitch = pitch
790
	sound.Looped = looped
791
	
792
	sound.MinDistance = 5
793
	sound.MaxDistance = 150
794
	sound.Volume = 0.65
795
	
796
	return sound
797
end
798
799
local head = script.Parent:FindFirstChild("Head")
800
if head == nil then
801
	error("Sound script parent has no child Head.")
802
	return
803
end
804
805
806
CreateNewSound("GettingUp", 	"rbxasset://sounds/action_get_up.mp3",					false, 	1,		head)
807
CreateNewSound("Died", 		"rbxasset://sounds/uuhhh.mp3",							false, 	1,		head) 
808
CreateNewSound("FreeFalling", 	"rbxasset://sounds/action_falling.mp3",				true,	1,		head)
809
CreateNewSound("Jumping", 		"rbxasset://sounds/action_jump.mp3",					false,	1,		head)
810
CreateNewSound("Landing", 		"rbxasset://sounds/action_jump_land.mp3",				false,	1,		head)
811
CreateNewSound("Splash", 		"rbxasset://sounds/impact_water.mp3",					false, 	1,		head)
812
CreateNewSound("Running", 		"rbxasset://sounds/action_footsteps_plastic.mp3",		true, 	1.85,	head)
813
CreateNewSound("Swimming", 	"rbxasset://sounds/action_swim.mp3",					true,	1.6,	head)
814
CreateNewSound("Climbing", 	"rbxasset://sounds/action_footsteps_plastic.mp3",		true,	1,		head)
815
end))
816
LocalScript28.Name = "LocalSound"
817
LocalScript28.Parent = Script27
818
table.insert(cors,sandbox(LocalScript28,function()
819
--[[
820
	Author: @spotco
821
	This script runs locally for the player of the given humanoid.
822
	This script triggers humanoid sound play/pause actions locally.
823
	
824
	The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
825
	immediately for the player and is replicated to all other players.
826
	
827
	This script is optimized to reduce network traffic through minimizing the amount of property replication.
828
]]--
829
830
--All sounds are referenced by this ID
831
local SFX = {
832
	Died = 0;
833
	Running = 1;
834
	Swimming = 2;
835
	Climbing = 3,
836
	Jumping = 4;
837
	GettingUp = 5;
838
	FreeFalling = 6;
839
	FallingDown = 7;
840
	Landing = 8;
841
	Splash = 9;
842
}
843
844
local Humanoid = nil
845
local Head = nil
846
847
--SFX ID to Sound object
848
local Sounds = {}
849
850
do
851
	local Figure = script.Parent.Parent
852
	Head = Figure:WaitForChild("Head")
853
	while not Humanoid do
854
		for _,NewHumanoid in pairs(Figure:GetChildren()) do
855
			if NewHumanoid:IsA("Humanoid") then
856
				Humanoid = NewHumanoid
857
				break
858
			end
859
		end
860
		Figure.ChildAdded:wait()
861
	end
862
	
863
	Sounds[SFX.Died] = 			Head:WaitForChild("Died")
864
	Sounds[SFX.Running] = 		Head:WaitForChild("Running")
865
	Sounds[SFX.Swimming] = 	Head:WaitForChild("Swimming")
866
	Sounds[SFX.Climbing] = 	Head:WaitForChild("Climbing")
867
	Sounds[SFX.Jumping] = 		Head:WaitForChild("Jumping")
868
	Sounds[SFX.GettingUp] = 	Head:WaitForChild("GettingUp")
869
	Sounds[SFX.FreeFalling] = 	Head:WaitForChild("FreeFalling")
870
	Sounds[SFX.Landing] = 		Head:WaitForChild("Landing")
871
	Sounds[SFX.Splash] = 		Head:WaitForChild("Splash")
872
end
873
874
local Util
875
Util = {
876
	
877
	--Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
878
	YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
879
		--(y - y1)/(x - x1) = m
880
		local m = (pt1y - pt2y) / (pt1x - pt2x)
881
		--float b = pt1.y - m * pt1.x;
882
		local b = (pt1y - m * pt1x)
883
		return m * x + b
884
	end;
885
	
886
	--Clamps the value of "val" between the "min" and "max"
887
	Clamp = function(val,min,max)
888
		return math.min(max,math.max(min,val))	
889
	end;
890
	
891
	--Gets the horizontal (x,z) velocity magnitude of the given part
892
	HorizontalSpeed = function(Head)
893
		local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
894
		return hVel.magnitude	
895
	end;
896
	
897
	--Gets the vertical (y) velocity magnitude of the given part
898
	VerticalSpeed = function(Head)
899
		return math.abs(Head.Velocity.Y)
900
	end;
901
	
902
	--Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
903
	--If these properties are enabled, use them.
904
	Play = function(sound)		
905
		if sound.TimePosition ~= 0 then
906
			sound.TimePosition = 0
907
		end
908
		if not sound.IsPlaying then
909
			sound.Playing = true
910
		end
911
	end;
912
	Pause = function(sound)
913
		if sound.IsPlaying then
914
			sound.Playing = false
915
		end
916
	end;
917
	Resume = function(sound)
918
		if not sound.IsPlaying then
919
			sound.Playing = true
920
		end
921-
	if dude.Name ~= char then
921+
922
	Stop = function(sound)
923-
		bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-50), 0, 0)
923+
924
			sound.Playing = false
925
		end
926
		if sound.TimePosition ~= 0 then
927
			sound.TimePosition = 0
928
		end
929
	end;
930
}
931
932
do
933
	-- List of all active Looped sounds
934
	local playingLoopedSounds = {}
935
	
936
	-- Last seen Enum.HumanoidStateType
937
	local activeState = nil
938
	
939
	-- Verify and set that "sound" is in "playingLoopedSounds".
940
	function setSoundInPlayingLoopedSounds(sound)
941
		for i=1, #playingLoopedSounds do
942
			if playingLoopedSounds[i] == sound then
943
				return
944
			end
945
		end	
946
		table.insert(playingLoopedSounds,sound)
947
	end
948
	
949
	-- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
950
	function stopPlayingLoopedSoundsExcept(except)
951
		for i=#playingLoopedSounds,1,-1 do
952
			if playingLoopedSounds[i] ~= except then
953
				Util.Pause(playingLoopedSounds[i])			
954
				table.remove(playingLoopedSounds,i)	
955
			end
956
		end
957
	end
958
	
959
	-- Table of Enum.HumanoidStateType to handling function
960
	local stateUpdateHandler = {
961
		[Enum.HumanoidStateType.Dead] = function()
962
			stopPlayingLoopedSoundsExcept()
963
			local sound = Sounds[SFX.Died]
964
			Util.Play(sound)
965
		end;
966
		
967
		[Enum.HumanoidStateType.RunningNoPhysics] = function()
968
			stateUpdated(Enum.HumanoidStateType.Running)
969
		end;
970
		
971
		[Enum.HumanoidStateType.Running] = function()	
972
			local sound = Sounds[SFX.Running]
973
			stopPlayingLoopedSoundsExcept(sound)
974
			
975
			if Util.HorizontalSpeed(Head) > 0.5 then
976
				Util.Resume(sound)
977
				setSoundInPlayingLoopedSounds(sound)
978
			else
979
				stopPlayingLoopedSoundsExcept()
980
			end
981
		end;
982
		
983
		[Enum.HumanoidStateType.Swimming] = function()
984
			if activeState ~= Enum.HumanoidStateType.Swimming and Util.VerticalSpeed(Head) > 0.1 then
985
				local splashSound = Sounds[SFX.Splash]
986
				splashSound.Volume = Util.Clamp(
987
					Util.YForLineGivenXAndTwoPts(
988
						Util.VerticalSpeed(Head), 
989
						100, 0.28, 
990
						350, 1),
991
					0,1)
992
				Util.Play(splashSound)
993
			end
994
			
995
			do
996
				local sound = Sounds[SFX.Swimming]
997
				stopPlayingLoopedSoundsExcept(sound)
998
				Util.Resume(sound)
999
				setSoundInPlayingLoopedSounds(sound)
1000
			end
1001
		end;
1002
		
1003-
		if v:IsA("Model") and v:findFirstChild("Head") and v ~= char and Distance >= (v.Head.Position - Position).magnitude then
1003+
1004
			local sound = Sounds[SFX.Climbing]
1005
			if Util.VerticalSpeed(Head) > 0.1 then
1006
				Util.Resume(sound)
1007
				stopPlayingLoopedSoundsExcept(sound)
1008
			else
1009
				stopPlayingLoopedSoundsExcept()
1010
			end		
1011
			setSoundInPlayingLoopedSounds(sound)
1012
		end;
1013
		
1014
		[Enum.HumanoidStateType.Jumping] = function()
1015
			if activeState == Enum.HumanoidStateType.Jumping then
1016
				return
1017
			end		
1018
			stopPlayingLoopedSoundsExcept()
1019
			local sound = Sounds[SFX.Jumping]
1020
			Util.Play(sound)
1021
		end;
1022
		
1023
		[Enum.HumanoidStateType.GettingUp] = function()
1024
			stopPlayingLoopedSoundsExcept()
1025
			local sound = Sounds[SFX.GettingUp]
1026
			Util.Play(sound)
1027
		end;
1028
		
1029
		[Enum.HumanoidStateType.Freefall] = function()
1030
			if activeState == Enum.HumanoidStateType.Freefall then
1031
				return
1032
			end
1033
			local sound = Sounds[SFX.FreeFalling]
1034
			sound.Volume = 0
1035
			stopPlayingLoopedSoundsExcept()
1036
		end;
1037
		
1038
		[Enum.HumanoidStateType.FallingDown] = function()
1039
			stopPlayingLoopedSoundsExcept()
1040
		end;
1041
		
1042
		[Enum.HumanoidStateType.Landed] = function()
1043
			stopPlayingLoopedSoundsExcept()
1044
			if Util.VerticalSpeed(Head) > 75 then
1045
				local landingSound = Sounds[SFX.Landing]
1046
				landingSound.Volume = Util.Clamp(
1047
					Util.YForLineGivenXAndTwoPts(
1048
						Util.VerticalSpeed(Head), 
1049
						50, 0, 
1050
						100, 1),
1051
					0,1)
1052
				Util.Play(landingSound)			
1053
			end
1054
		end;
1055
		
1056
		[Enum.HumanoidStateType.Seated] = function()
1057
			stopPlayingLoopedSoundsExcept()
1058
		end;	
1059
	}
1060
	
1061
	-- Handle state event fired or OnChange fired
1062
	function stateUpdated(state)
1063
		if stateUpdateHandler[state] ~= nil then
1064
			stateUpdateHandler[state]()
1065
		end
1066
		activeState = state
1067
	end
1068
	
1069
	Humanoid.Died:connect(			function() stateUpdated(Enum.HumanoidStateType.Dead) 			end)
1070
	Humanoid.Running:connect(		function() stateUpdated(Enum.HumanoidStateType.Running) 		end)
1071
	Humanoid.Swimming:connect(		function() stateUpdated(Enum.HumanoidStateType.Swimming) 		end)
1072
	Humanoid.Climbing:connect(		function() stateUpdated(Enum.HumanoidStateType.Climbing) 		end)
1073
	Humanoid.Jumping:connect(		function() stateUpdated(Enum.HumanoidStateType.Jumping) 		end)
1074
	Humanoid.GettingUp:connect(		function() stateUpdated(Enum.HumanoidStateType.GettingUp) 		end)
1075
	Humanoid.FreeFalling:connect(		function() stateUpdated(Enum.HumanoidStateType.Freefall) 		end)
1076
	Humanoid.FallingDown:connect(		function() stateUpdated(Enum.HumanoidStateType.FallingDown) 	end)
1077
	
1078
	-- required for proper handling of Landed event
1079
	Humanoid.StateChanged:connect(function(old, new)
1080
		stateUpdated(new)
1081
	end)
1082
	
1083
	
1084
	function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
1085
		local stepScale = stepDeltaSeconds / tickSpeedSeconds
1086
		do
1087
			local sound = Sounds[SFX.FreeFalling]
1088
			if activeState == Enum.HumanoidStateType.Freefall then
1089
				if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
1090
					Util.Resume(sound)
1091
					
1092
					--Volume takes 1.1 seconds to go from volume 0 to 1
1093
					local ANIMATION_LENGTH_SECONDS = 1.1
1094
					
1095
					local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS									
1096
					sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
1097
				else
1098
					sound.Volume = 0
1099
				end			
1100
			else
1101
				Util.Pause(sound)
1102
			end
1103
		end
1104
		
1105
		do
1106
			local sound = Sounds[SFX.Running]
1107
			if activeState == Enum.HumanoidStateType.Running then
1108
				if Util.HorizontalSpeed(Head) < 0.5 then
1109
					Util.Pause(sound)
1110
				end
1111
			end
1112
		end		
1113
	end
1114
	
1115
	local lastTick = tick()
1116
	local TICK_SPEED_SECONDS = 0.25
1117
	while true do
1118
		onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
1119
		lastTick = tick()
1120
		wait(TICK_SPEED_SECONDS)
1121
	end
1122
end
1123
1124
end))
1125
LocalScript29.Name = "Animate"
1126
LocalScript29.Parent = Model0
1127
table.insert(cors,sandbox(LocalScript29,function()
1128-
    if key == "t" then
1128+
1129
	local child = parent:findFirstChild(childName)
1130
	if child then return child end
1131
	while true do
1132
		child = parent.ChildAdded:wait()
1133
		if child.Name==childName then return child end
1134
	end
1135
end
1136
1137
local Figure = script.Parent
1138
local Torso = waitForChild(Figure, "Torso")
1139
local RightShoulder = waitForChild(Torso, "Right Shoulder")
1140
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
1141
local RightHip = waitForChild(Torso, "Right Hip")
1142
local LeftHip = waitForChild(Torso, "Left Hip")
1143
local Neck = waitForChild(Torso, "Neck")
1144
local Humanoid = waitForChild(Figure, "Humanoid")
1145
local pose = "Standing"
1146
1147
local currentAnim = ""
1148
local currentAnimInstance = nil
1149
local currentAnimTrack = nil
1150
local currentAnimKeyframeHandler = nil
1151
local currentAnimSpeed = 1.0
1152
local animTable = {}
1153
local animNames = { 
1154
	idle = 	{	
1155
				{ id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
1156
				{ id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
1157
			},
1158
	walk = 	{ 	
1159
				{ id = "http://www.roblox.com/asset/?id=180426354", weight = 10 } 
1160
			}, 
1161
	run = 	{
1162
				{ id = "run.xml", weight = 10 } 
1163
			}, 
1164
	jump = 	{
1165
				{ id = "http://www.roblox.com/asset/?id=125750702", weight = 10 } 
1166
			}, 
1167
	fall = 	{
1168
				{ id = "http://www.roblox.com/asset/?id=180436148", weight = 10 } 
1169
			}, 
1170
	climb = {
1171
				{ id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } 
1172
			}, 
1173
	sit = 	{
1174
				{ id = "http://www.roblox.com/asset/?id=178130996", weight = 10 } 
1175
			},	
1176
	toolnone = {
1177
				{ id = "http://www.roblox.com/asset/?id=182393478", weight = 10 } 
1178
			},
1179
	toolslash = {
1180
				{ id = "http://www.roblox.com/asset/?id=129967390", weight = 10 } 
1181
--				{ id = "slash.xml", weight = 10 } 
1182
			},
1183
	toollunge = {
1184
				{ id = "http://www.roblox.com/asset/?id=129967478", weight = 10 } 
1185
			},
1186
	wave = {
1187
				{ id = "http://www.roblox.com/asset/?id=128777973", weight = 10 } 
1188
			},
1189
	point = {
1190
				{ id = "http://www.roblox.com/asset/?id=128853357", weight = 10 } 
1191
			},
1192
	dance1 = {
1193
				{ id = "http://www.roblox.com/asset/?id=182435998", weight = 10 }, 
1194
				{ id = "http://www.roblox.com/asset/?id=182491037", weight = 10 }, 
1195
				{ id = "http://www.roblox.com/asset/?id=182491065", weight = 10 } 
1196
			},
1197
	dance2 = {
1198
				{ id = "http://www.roblox.com/asset/?id=182436842", weight = 10 }, 
1199
				{ id = "http://www.roblox.com/asset/?id=182491248", weight = 10 }, 
1200
				{ id = "http://www.roblox.com/asset/?id=182491277", weight = 10 } 
1201
			},
1202
	dance3 = {
1203
				{ id = "http://www.roblox.com/asset/?id=182436935", weight = 10 }, 
1204
				{ id = "http://www.roblox.com/asset/?id=182491368", weight = 10 }, 
1205
				{ id = "http://www.roblox.com/asset/?id=182491423", weight = 10 } 
1206
			},
1207
	laugh = {
1208
				{ id = "http://www.roblox.com/asset/?id=129423131", weight = 10 } 
1209
			},
1210
	cheer = {
1211
				{ id = "http://www.roblox.com/asset/?id=129423030", weight = 10 } 
1212
			},
1213
}
1214
local dances = {"dance1", "dance2", "dance3"}
1215
1216
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
1217
local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
1218
1219
function configureAnimationSet(name, fileList)
1220
	if (animTable[name] ~= nil) then
1221
		for _, connection in pairs(animTable[name].connections) do
1222
			connection:disconnect()
1223
		end
1224
	end
1225
	animTable[name] = {}
1226
	animTable[name].count = 0
1227
	animTable[name].totalWeight = 0	
1228
	animTable[name].connections = {}
1229
1230
	-- check for config values
1231
	local config = script:FindFirstChild(name)
1232
	if (config ~= nil) then
1233
--		print("Loading anims " .. name)
1234
		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
1235
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
1236
		local idx = 1
1237
		for _, childPart in pairs(config:GetChildren()) do
1238
			if (childPart:IsA("Animation")) then
1239
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
1240
				animTable[name][idx] = {}
1241
				animTable[name][idx].anim = childPart
1242
				local weightObject = childPart:FindFirstChild("Weight")
1243
				if (weightObject == nil) then
1244
					animTable[name][idx].weight = 1
1245
				else
1246
					animTable[name][idx].weight = weightObject.Value
1247
				end
1248
				animTable[name].count = animTable[name].count + 1
1249
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
1250
	--			print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
1251
				idx = idx + 1
1252
			end
1253
		end
1254
	end
1255
1256
	-- fallback to defaults
1257
	if (animTable[name].count <= 0) then
1258
		for idx, anim in pairs(fileList) do
1259
			animTable[name][idx] = {}
1260
			animTable[name][idx].anim = Instance.new("Animation")
1261
			animTable[name][idx].anim.Name = name
1262
			animTable[name][idx].anim.AnimationId = anim.id
1263
			animTable[name][idx].weight = anim.weight
1264
			animTable[name].count = animTable[name].count + 1
1265
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
1266
--			print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
1267
		end
1268
	end
1269
end
1270
1271
-- Setup animation objects
1272
1273
function chatfunc(text, color)
1274
local cha = Torso
1275
    local chat = coroutine.wrap(function()
1276
        if cha:FindFirstChild("TalkingBillBoard") ~= nil then
1277
            cha:FindFirstChild("TalkingBillBoard"):destroy()
1278
        end
1279
        local naeeym2 = Instance.new("BillboardGui", cha)
1280
        naeeym2.Size = UDim2.new(0, 100, 0, 40)
1281
        naeeym2.StudsOffset = Vector3.new(0, 3, 0)
1282
        naeeym2.Adornee = hed
1283
        naeeym2.Name = "TalkingBillBoard"
1284
        local tecks2 = Instance.new("TextLabel", naeeym2)
1285
        tecks2.BackgroundTransparency = 1
1286
        tecks2.BorderSizePixel = 0
1287
        tecks2.Text = ""
1288
        tecks2.Font = "Fantasy"
1289
        tecks2.TextSize = 30
1290
        tecks2.TextStrokeTransparency = 0
1291
        tecks2.TextColor3 = color
1292
        tecks2.TextStrokeColor3 = Color3.new(232, 186, 200)
1293
        tecks2.Size = UDim2.new(1, 0, 0.5, 0)
1294
        local tecks3 = Instance.new("TextLabel", naeeym2)
1295
        tecks3.BackgroundTransparency = 1
1296
        tecks3.BorderSizePixel = 0
1297
        tecks3.Text = ""
1298
        tecks3.Font = "Fantasy"
1299
        tecks3.TextSize = 30
1300
        tecks3.TextStrokeTransparency = 0
1301
        tecks3.TextColor3 = Color3.new(0, 0, 0)
1302
        tecks3.TextStrokeColor3 = color
1303
        tecks3.Size = UDim2.new(1, 0, 0.5, 0)
1304
        coroutine.resume(coroutine.create(function()
1305
            while true do
1306
                swait(1)
1307
                tecks2.Position = UDim2.new(0, math.random(-5, 5), 0, math.random(-5, 5))
1308
                tecks3.Position = UDim2.new(0, math.random(-5, 5), 0, math.random(-5, 5))
1309
                tecks2.Rotation = math.random(-5, 5)
1310
                tecks3.Rotation = math.random(-5, 5)
1311
            end
1312
        end))
1313
        for i = 1, string.len(text) do
1314
            tecks2.Text = string.sub(text, 1, i)
1315
            tecks3.Text = string.sub(text, 1, i)
1316
            swait(1)
1317
        end
1318
        wait(1)
1319
        local randomrot = math.random(1, 2)
1320
        if randomrot == 1 then
1321
            for i = 1, 50 do
1322
                swait()
1323
                tecks2.Rotation = tecks2.Rotation - 0.75
1324
                tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
1325
                tecks2.TextTransparency = tecks2.TextTransparency + 0.04
1326
                tecks3.Rotation = tecks2.Rotation + 0.75
1327
                tecks3.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
1328
                tecks3.TextTransparency = tecks2.TextTransparency + 0.04
1329
            end
1330
        elseif randomrot == 2 then
1331
            for i = 1, 50 do
1332
                swait()
1333
                tecks2.Rotation = tecks2.Rotation + 0.75
1334
                tecks2.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
1335
                tecks2.TextTransparency = tecks2.TextTransparency + 0.04
1336
                tecks3.Rotation = tecks2.Rotation - 0.75
1337
                tecks3.TextStrokeTransparency = tecks2.TextStrokeTransparency + 0.04
1338
                tecks3.TextTransparency = tecks2.TextTransparency + 0.04
1339
            end
1340
        end
1341
        naeeym2:Destroy()
1342
    end)
1343
    chat()
1344
end
1345
1346
function Eviscerate(dude)
1347
cam = game.Workspace.CurrentCamera
1348
CF = CFrame.new
1349
angles = CFrame.Angles
1350
attack = false
1351
Euler = CFrame.fromEulerAnglesXYZ
1352
Rad = math.rad
1353
IT = Instance.new
1354
BrickC = BrickColor.new
1355
Cos = math.cos
1356
Acos = math.acos
1357
Sin = math.sin
1358
Asin = math.asin
1359
Abs = math.abs
1360
Mrandom = math.random
1361
Floor = math.floor
1362
	if dude.Name ~= cha then
1363
		local bgf = IT("BodyGyro", dude.Head)
1364
		bgf.CFrame = bgf.CFrame * CFrame.fromEulerAnglesXYZ(Rad(-10), 0, 0)
1365
		local val = IT("BoolValue", dude)
1366
		val.Name = "IsHit"
1367
		local ds = coroutine.wrap(function()
1368
			dude:WaitForChild("Head"):BreakJoints()
1369
			wait(0.5)
1370
			target = nil
1371
			coroutine.resume(coroutine.create(function()
1372
				for i, v in pairs(dude:GetChildren()) do
1373
					if v:IsA("Accessory") then
1374
						v:Destroy()
1375
					end
1376
					if v:IsA("Humanoid") then
1377
						v:Destroy()
1378
					end
1379
					if v:IsA("CharacterMesh") then
1380
						v:Destroy()
1381
					end
1382
					if v:IsA("Model") then
1383
						v:Destroy()
1384
					end
1385
					if v:IsA("Part") or v:IsA("MeshPart") then
1386
						for x, o in pairs(v:GetChildren()) do
1387
							if o:IsA("Decal") then
1388
								o:Destroy()
1389
							end
1390
						end
1391
						coroutine.resume(coroutine.create(function()
1392
							v.Material = "Neon"
1393
							v.CanCollide = false
1394
							local PartEmmit1 = IT("ParticleEmitter", v)
1395
							PartEmmit1.LightEmission = 1
1396
							PartEmmit1.Texture = "rbxassetid://0"
1397
							PartEmmit1.Color = ColorSequence.new(maincolor.Color)
1398
							PartEmmit1.Rate = 150
1399
							PartEmmit1.Lifetime = NumberRange.new(1)
1400
							PartEmmit1.Size = NumberSequence.new({
1401
								NumberSequenceKeypoint.new(0, 0.75, 0),
1402
								NumberSequenceKeypoint.new(1, 0, 0)
1403
							})
1404
							PartEmmit1.Transparency = NumberSequence.new({
1405
								NumberSequenceKeypoint.new(0, 0, 0),
1406
								NumberSequenceKeypoint.new(1, 1, 0)
1407
							})
1408
							PartEmmit1.Speed = NumberRange.new(0, 0)
1409
							PartEmmit1.VelocitySpread = 30000
1410
							PartEmmit1.Rotation = NumberRange.new(-500, 500)
1411
							PartEmmit1.RotSpeed = NumberRange.new(-500, 500)
1412
							local BodPoss = IT("BodyPosition", v)
1413
							BodPoss.P = 3000
1414
							BodPoss.D = 1000
1415
							BodPoss.maxForce = Vector3.new(50000000000, 50000000000, 50000000000)
1416
							BodPoss.position = v.Position + Vector3.new(Mrandom(-15, 15), Mrandom(-15, 15), Mrandom(-15, 15))
1417
							v.Color = maincolor.Color
1418
							coroutine.resume(coroutine.create(function()
1419
								for i = 0, 49 do
1420
									swait(1)
1421
									v.Transparency = v.Transparency + 0.08
1422
								end
1423
								wait(0.5)
1424
								PartEmmit1.Enabled = false
1425
								wait(3)
1426
								v:Destroy()
1427
								dude:Destroy()
1428
							end))
1429
						end))
1430
					end
1431
				end
1432
			end))
1433
		end)
1434
		ds()
1435
	end
1436
end
1437
1438
function FindNearestHead(Position, Distance, SinglePlayer)
1439
	if SinglePlayer then
1440
		return Distance > (SinglePlayer.Torso.CFrame.p - Position).magnitude
1441
	end
1442
	local List = {}
1443
	for i, v in pairs(workspace:GetChildren()) do
1444
		if v:IsA("Model") and v:findFirstChild("Head") and v ~= cha and Distance >= (v.Head.Position - Position).magnitude then
1445
			table.insert(List, v)
1446
		end
1447
	end
1448
	return List
1449
end
1450
function scriptChildModified(child)
1451
	local fileList = animNames[child.Name]
1452
	if (fileList ~= nil) then
1453
		configureAnimationSet(child.Name, fileList)
1454
	end	
1455
end
1456
1457
script.ChildAdded:connect(scriptChildModified)
1458
script.ChildRemoved:connect(scriptChildModified)
1459
1460
1461
for name, fileList in pairs(animNames) do 
1462
	configureAnimationSet(name, fileList)
1463
end	
1464
1465
-- ANIMATION
1466
1467
-- declarations
1468
local toolAnim = "None"
1469
local toolAnimTime = 0
1470
1471
local jumpAnimTime = 0
1472
local jumpAnimDuration = 0.3
1473
1474
local toolTransitionTime = 0.1
1475
local fallTransitionTime = 0.3
1476
local jumpMaxLimbVelocity = 0.75
1477
1478
-- functions
1479
1480
function stopAllAnimations()
1481
	local oldAnim = currentAnim
1482
1483
	-- return to idle if finishing an emote
1484
	if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
1485
		oldAnim = "idle"
1486
	end
1487
1488
	currentAnim = ""
1489
	currentAnimInstance = nil
1490
	if (currentAnimKeyframeHandler ~= nil) then
1491
		currentAnimKeyframeHandler:disconnect()
1492
	end
1493
1494
	if (currentAnimTrack ~= nil) then
1495
		currentAnimTrack:Stop()
1496
		currentAnimTrack:Destroy()
1497
		currentAnimTrack = nil
1498
	end
1499
	return oldAnim
1500
end
1501
1502
function setAnimationSpeed(speed)
1503
	if speed ~= currentAnimSpeed then
1504
		currentAnimSpeed = speed
1505
		currentAnimTrack:AdjustSpeed(currentAnimSpeed)
1506
	end
1507
end
1508
1509
function keyFrameReachedFunc(frameName)
1510
	if (frameName == "End") then
1511
1512
		local repeatAnim = currentAnim
1513
		-- return to idle if finishing an emote
1514
		if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
1515
			repeatAnim = "idle"
1516
		end
1517
		
1518
		local animSpeed = currentAnimSpeed
1519
		playAnimation(repeatAnim, 0.0, Humanoid)
1520
		setAnimationSpeed(animSpeed)
1521
	end
1522
end
1523
1524
-- Preload animations
1525
function playAnimation(animName, transitionTime, humanoid) 
1526
		
1527
	local roll = math.random(1, animTable[animName].totalWeight) 
1528
	local origRoll = roll
1529
	local idx = 1
1530
	while (roll > animTable[animName][idx].weight) do
1531
		roll = roll - animTable[animName][idx].weight
1532
		idx = idx + 1
1533
	end
1534
--		print(animName .. " " .. idx .. " [" .. origRoll .. "]")
1535
	local anim = animTable[animName][idx].anim
1536
1537
	-- switch animation		
1538
	if (anim ~= currentAnimInstance) then
1539
		
1540
		if (currentAnimTrack ~= nil) then
1541
			currentAnimTrack:Stop(transitionTime)
1542
			currentAnimTrack:Destroy()
1543
		end
1544
1545
		currentAnimSpeed = 1.0
1546
	
1547
		-- load it to the humanoid; get AnimationTrack
1548
		currentAnimTrack = humanoid:LoadAnimation(anim)
1549
		 
1550
		-- play the animation
1551
		currentAnimTrack:Play(transitionTime)
1552
		currentAnim = animName
1553
		currentAnimInstance = anim
1554
1555
		-- set up keyframe name triggers
1556
		if (currentAnimKeyframeHandler ~= nil) then
1557
			currentAnimKeyframeHandler:disconnect()
1558
		end
1559
		currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
1560
		
1561
	end
1562
1563
end
1564
1565
-------------------------------------------------------------------------------------------
1566
----------------------------------------------------------------------------------
1567
wait()
1568
Mouse.KeyDown:connect(function(key)
1569
    if key == "e" then
1570
        wait()
1571
    for i, v in pairs(FindNearestHead(mouse.Hit.p, 14.5)) do
1572
        if v:FindFirstChild("Head") then
1573
            Eviscerate(v)
1574
    end
1575
    end
1576
        dist = (Torso.Position - Mouse.Hit.p).magnitude
1577
        if dist <= 10000 then
1578
            Torso.CFrame = CFrame.new(Mouse.Hit.p) + Vector3.new(0,3,0)
1579
        end
1580
    elseif key == "q" then
1581
        chatfunc("", BrickColor.new("Red").Color)
1582
end
1583
end)
1584
1585
----------------------------------------------------------------------------------
1586
-------------------------------------------------------------------------------------------
1587
1588
local toolAnimName = ""
1589
local toolAnimTrack = nil
1590
local toolAnimInstance = nil
1591
local currentToolAnimKeyframeHandler = nil
1592
1593
function toolKeyFrameReachedFunc(frameName)
1594
	if (frameName == "End") then
1595
--		print("Keyframe : ".. frameName)	
1596
		playToolAnimation(toolAnimName, 0.0, Humanoid)
1597
	end
1598
end
1599
1600
1601
function playToolAnimation(animName, transitionTime, humanoid)	 
1602
		
1603
		local roll = math.random(1, animTable[animName].totalWeight) 
1604
		local origRoll = roll
1605
		local idx = 1
1606
		while (roll > animTable[animName][idx].weight) do
1607
			roll = roll - animTable[animName][idx].weight
1608
			idx = idx + 1
1609
		end
1610
--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
1611
		local anim = animTable[animName][idx].anim
1612
1613
		if (toolAnimInstance ~= anim) then
1614
			
1615
			if (toolAnimTrack ~= nil) then
1616
				toolAnimTrack:Stop()
1617
				toolAnimTrack:Destroy()
1618
				transitionTime = 0
1619
			end
1620
					
1621
			-- load it to the humanoid; get AnimationTrack
1622
			toolAnimTrack = humanoid:LoadAnimation(anim)
1623
			 
1624
			-- play the animation
1625
			toolAnimTrack:Play(transitionTime)
1626
			toolAnimName = animName
1627
			toolAnimInstance = anim
1628
1629
			currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
1630
		end
1631
end
1632
1633
function stopToolAnimations()
1634
	local oldAnim = toolAnimName
1635
1636
	if (currentToolAnimKeyframeHandler ~= nil) then
1637
		currentToolAnimKeyframeHandler:disconnect()
1638
	end
1639
1640
	toolAnimName = ""
1641
	toolAnimInstance = nil
1642
	if (toolAnimTrack ~= nil) then
1643
		toolAnimTrack:Stop()
1644
		toolAnimTrack:Destroy()
1645
		toolAnimTrack = nil
1646
	end
1647
1648
1649
	return oldAnim
1650
end
1651
1652
-------------------------------------------------------------------------------------------
1653
-------------------------------------------------------------------------------------------
1654
1655
1656
function onRunning(speed)
1657
	if speed>0.01 then
1658
		playAnimation("walk", 0.1, Humanoid)
1659
		if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
1660
			setAnimationSpeed(speed / 14.5)
1661
		end
1662
		pose = "Running"
1663
	else
1664
		if emoteNames[currentAnim] == nil then
1665
			playAnimation("idle", 0.1, Humanoid)
1666
			pose = "Standing"
1667
		end
1668
	end
1669
end
1670
1671
function onDied()
1672
	pose = "Dead"
1673
end
1674
1675
function onJumping()
1676
	playAnimation("jump", 0.1, Humanoid)
1677
	jumpAnimTime = jumpAnimDuration
1678
	pose = "Jumping"
1679
end
1680
1681
function onClimbing(speed)
1682
	playAnimation("climb", 0.1, Humanoid)
1683
	setAnimationSpeed(speed / 12.0)
1684
	pose = "Climbing"
1685
end
1686
1687
function onGettingUp()
1688
	pose = "GettingUp"
1689
end
1690
1691
function onFreeFall()
1692
	if (jumpAnimTime <= 0) then
1693
		playAnimation("fall", fallTransitionTime, Humanoid)
1694
	end
1695
	pose = "FreeFall"
1696
end
1697
1698
function onFallingDown()
1699
	pose = "FallingDown"
1700
end
1701
1702
function onSeated()
1703
	pose = "Seated"
1704
end
1705
1706
function onPlatformStanding()
1707
	pose = "PlatformStanding"
1708
end
1709
1710
function onSwimming(speed)
1711
	if speed>0 then
1712
		pose = "Running"
1713
	else
1714
		pose = "Standing"
1715
	end
1716
end
1717
1718
function getTool()	
1719
	for _, kid in ipairs(Figure:GetChildren()) do
1720
		if kid.className == "Tool" then return kid end
1721
	end
1722
	return nil
1723
end
1724
1725
function getToolAnim(tool)
1726
	for _, c in ipairs(tool:GetChildren()) do
1727
		if c.Name == "toolanim" and c.className == "StringValue" then
1728
			return c
1729
		end
1730
	end
1731
	return nil
1732
end
1733
1734
function animateTool()
1735
	
1736
	if (toolAnim == "None") then
1737
		playToolAnimation("toolnone", toolTransitionTime, Humanoid)
1738
		return
1739
	end
1740
1741
	if (toolAnim == "Slash") then
1742
		playToolAnimation("toolslash", 0, Humanoid)
1743
		return
1744
	end
1745
1746
	if (toolAnim == "Lunge") then
1747
		playToolAnimation("toollunge", 0, Humanoid)
1748
		return
1749
	end
1750
end
1751
1752
function moveSit()
1753
	RightShoulder.MaxVelocity = 0.15
1754
	LeftShoulder.MaxVelocity = 0.15
1755
	RightShoulder:SetDesiredAngle(3.14 /2)
1756
	LeftShoulder:SetDesiredAngle(-3.14 /2)
1757
	RightHip:SetDesiredAngle(3.14 /2)
1758
	LeftHip:SetDesiredAngle(-3.14 /2)
1759
end
1760
1761
local lastTick = 0
1762
1763
function move(time)
1764
	local amplitude = 1
1765
	local frequency = 1
1766
  	local deltaTime = time - lastTick
1767
  	lastTick = time
1768
1769
	local climbFudge = 0
1770
	local setAngles = false
1771
1772
  	if (jumpAnimTime > 0) then
1773
  		jumpAnimTime = jumpAnimTime - deltaTime
1774
  	end
1775
1776
	if (pose == "FreeFall" and jumpAnimTime <= 0) then
1777
		playAnimation("fall", fallTransitionTime, Humanoid)
1778
	elseif (pose == "Seated") then
1779
		playAnimation("sit", 0.5, Humanoid)
1780
		return
1781
	elseif (pose == "Running") then
1782
		playAnimation("walk", 0.1, Humanoid)
1783
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
1784
--		print("Wha " .. pose)
1785
		stopAllAnimations()
1786
		amplitude = 0.1
1787
		frequency = 1
1788
		setAngles = true
1789
	end
1790
1791
	if (setAngles) then
1792
		desiredAngle = amplitude * math.sin(time * frequency)
1793
1794
		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
1795
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
1796
		RightHip:SetDesiredAngle(-desiredAngle)
1797
		LeftHip:SetDesiredAngle(-desiredAngle)
1798
	end
1799
1800
	-- Tool Animation handling
1801
	local tool = getTool()
1802
	if tool and tool:FindFirstChild("Handle") then
1803
	
1804
		animStringValueObject = getToolAnim(tool)
1805
1806
		if animStringValueObject then
1807
			toolAnim = animStringValueObject.Value
1808
			-- message recieved, delete StringValue
1809
			animStringValueObject.Parent = nil
1810
			toolAnimTime = time + .3
1811
		end
1812
1813
		if time > toolAnimTime then
1814
			toolAnimTime = 0
1815
			toolAnim = "None"
1816
		end
1817
1818
		animateTool()		
1819
	else
1820
		stopToolAnimations()
1821
		toolAnim = "None"
1822
		toolAnimInstance = nil
1823
		toolAnimTime = 0
1824
	end
1825
end
1826
1827
-- connect events
1828
Humanoid.Died:connect(onDied)
1829
Humanoid.Running:connect(onRunning)
1830
Humanoid.Jumping:connect(onJumping)
1831
Humanoid.Climbing:connect(onClimbing)
1832
Humanoid.GettingUp:connect(onGettingUp)
1833
Humanoid.FreeFalling:connect(onFreeFall)
1834
Humanoid.FallingDown:connect(onFallingDown)
1835
Humanoid.Seated:connect(onSeated)
1836
Humanoid.PlatformStanding:connect(onPlatformStanding)
1837
Humanoid.Swimming:connect(onSwimming)
1838
1839
-- setup emote chat hook
1840
owner.Chatted:connect(function(msg)
1841
	local emote = ""
1842
	if msg == "/e dance" then
1843
		emote = dances[math.random(1, #dances)]
1844
	elseif (string.sub(msg, 1, 3) == "/e ") then
1845
		emote = string.sub(msg, 4)
1846
	elseif (string.sub(msg, 1, 7) == "/emote ") then
1847
		emote = string.sub(msg, 8)
1848
	end
1849
	
1850
	if (pose == "Standing" and emoteNames[emote] ~= nil) then
1851
		playAnimation(emote, 0.1, Humanoid)
1852
	end
1853
1854
end)
1855
1856
1857
-- main program
1858
1859
local runService = game:service("RunService");
1860
1861
-- initialize to idle
1862
playAnimation("idle", 0.1, Humanoid)
1863
pose = "Standing"
1864
1865
while Figure.Parent~=nil do
1866
	local _, time = wait(0.1)
1867
	move(time)
1868
end
1869
1870
1871
1872
end))
1873
StringValue30.Name = "idle"
1874
StringValue30.Parent = LocalScript29
1875
Animation31.Name = "Animation1"
1876
Animation31.Parent = StringValue30
1877
Animation31.AnimationId = "http://www.roblox.com/asset/?id=180435571"
1878
NumberValue32.Name = "Weight"
1879
NumberValue32.Parent = Animation31
1880
NumberValue32.Value = 9
1881
Animation33.Name = "Animation2"
1882
Animation33.Parent = StringValue30
1883
Animation33.AnimationId = "http://www.roblox.com/asset/?id=180435792"
1884
NumberValue34.Name = "Weight"
1885
NumberValue34.Parent = Animation33
1886
NumberValue34.Value = 1
1887
StringValue35.Name = "walk"
1888
StringValue35.Parent = LocalScript29
1889
Animation36.Name = "WalkAnim"
1890
Animation36.Parent = StringValue35
1891
Animation36.AnimationId = "http://www.roblox.com/asset/?id=180426354"
1892
StringValue37.Name = "run"
1893
StringValue37.Parent = LocalScript29
1894
Animation38.Name = "RunAnim"
1895
Animation38.Parent = StringValue37
1896
Animation38.AnimationId = "http://www.roblox.com/asset/?id=180426354"
1897
StringValue39.Name = "jump"
1898
StringValue39.Parent = LocalScript29
1899
Animation40.Name = "JumpAnim"
1900
Animation40.Parent = StringValue39
1901
Animation40.AnimationId = "http://www.roblox.com/asset/?id=125750702"
1902
StringValue41.Name = "climb"
1903
StringValue41.Parent = LocalScript29
1904
Animation42.Name = "ClimbAnim"
1905
Animation42.Parent = StringValue41
1906
Animation42.AnimationId = "http://www.roblox.com/asset/?id=180436334"
1907
StringValue43.Name = "toolnone"
1908
StringValue43.Parent = LocalScript29
1909
Animation44.Name = "ToolNoneAnim"
1910
Animation44.Parent = StringValue43
1911
Animation44.AnimationId = "http://www.roblox.com/asset/?id=182393478"
1912
StringValue45.Name = "fall"
1913
StringValue45.Parent = LocalScript29
1914
Animation46.Name = "FallAnim"
1915
Animation46.Parent = StringValue45
1916
Animation46.AnimationId = "http://www.roblox.com/asset/?id=180436148"
1917
StringValue47.Name = "sit"
1918
StringValue47.Parent = LocalScript29
1919
Animation48.Name = "SitAnim"
1920
Animation48.Parent = StringValue47
1921
Animation48.AnimationId = "http://www.roblox.com/asset/?id=178130996"
1922
Script49.Name = "Health"
1923
Script49.Parent = Model0
1924
table.insert(cors,sandbox(Script49,function()
1925
--Responsible for regening a player's humanoid's health
1926
1927
-- declarations
1928
local Figure = script.Parent
1929
local Head = Figure:WaitForChild("Head")
1930
local Humanoid = Figure:WaitForChild("Humanoid")
1931
local regening = false
1932
1933
-- regeneration
1934
function regenHealth()
1935
	if regening then return end
1936
	regening = true
1937
	
1938
	while Humanoid.Health < Humanoid.MaxHealth do
1939
		local s = wait(1)
1940
		local health = Humanoid.Health
1941
		if health > 0 and health < Humanoid.MaxHealth then
1942
			local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
1943
			health = health + newHealthDelta
1944
			Humanoid.Health = math.min(health,Humanoid.MaxHealth)
1945
		end
1946
	end
1947
	
1948
	if Humanoid.Health > Humanoid.MaxHealth then
1949
		Humanoid.Health = Humanoid.MaxHealth
1950
	end
1951
	
1952
	regening = false
1953
end
1954
1955
Humanoid.HealthChanged:connect(regenHealth)
1956
  
1957
end))
1958
BodyColors50.Parent = Model0
1959
BodyColors50.HeadColor = BrickColor.new("Mid gray")
1960
BodyColors50.HeadColor3 = Color3.new(0.803922, 0.803922, 0.803922)
1961
BodyColors50.LeftArmColor = BrickColor.new("Mid gray")
1962
BodyColors50.LeftArmColor3 = Color3.new(0.803922, 0.803922, 0.803922)
1963
BodyColors50.LeftLegColor = BrickColor.new("Pastel light blue")
1964
BodyColors50.LeftLegColor3 = Color3.new(0.686275, 0.866667, 1)
1965
BodyColors50.RightArmColor = BrickColor.new("Mid gray")
1966
BodyColors50.RightArmColor3 = Color3.new(0.803922, 0.803922, 0.803922)
1967
BodyColors50.RightLegColor = BrickColor.new("Pastel light blue")
1968
BodyColors50.RightLegColor3 = Color3.new(0.686275, 0.866667, 1)
1969
BodyColors50.TorsoColor = BrickColor.new("Bright green")
1970
BodyColors50.TorsoColor3 = Color3.new(0.294118, 0.592157, 0.294118)
1971
for i,v in pairs(mas:GetChildren()) do
1972
	v.Parent = owner.Character
1973
	pcall(function() v:MakeJoints() end)
1974
end
1975
mas:Destroy()
1976
for i,v in pairs(cors) do
1977
	spawn(function()
1978
		pcall(v)
1979
	end)
1980
end