View difference between Paste ID: aQ52SE3u and isDvV8gF
SHOW: | | - or go back to the newest paste.
1
--https://github.com/Mokiros/roblox-FE-compatibility
2
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
3
local Player,game,owner = owner,game
4
local RealPlayer = Player
5
do
6
	print("FE Compatibility code V2 by Mokiros")
7
	local RealPlayer = RealPlayer
8
	script.Parent = RealPlayer.Character
9
10
	--Fake event to make stuff like Mouse.KeyDown work
11
	local Disconnect_Function = function(this)
12
		this[1].Functions[this[2]] = nil
13
	end
14
	local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
15
	local FakeEvent_Metatable = {__index={
16
		Connect = function(this,f)
17
			local i = tostring(math.random(0,10000))
18
			while this.Functions[i] do
19
				i = tostring(math.random(0,10000))
20
			end
21
			this.Functions[i] = f
22
			return setmetatable({this,i},Disconnect_Metatable)
23
		end
24
	}}
25
	FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
26
	local function fakeEvent()
27
		return setmetatable({Functions={}},FakeEvent_Metatable)
28
	end
29
30
	--Creating fake input objects with fake variables
31
    local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
32
    FakeMouse.keyUp = FakeMouse.KeyUp
33
    FakeMouse.keyDown = FakeMouse.KeyDown
34
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
35
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
36
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
37
	end}
38
	--Merged 2 functions into one by checking amount of arguments
39
	CAS.UnbindAction = CAS.BindAction
40
41
	--This function will trigger the events that have been :Connect()'ed
42
	local function TriggerEvent(self,ev,...)
43
		for _,f in pairs(self[ev].Functions) do
44
			f(...)
45
		end
46
	end
47
	FakeMouse.TriggerEvent = TriggerEvent
48
	UIS.TriggerEvent = TriggerEvent
49
50
	--Client communication
51
	local Event = Instance.new("RemoteEvent")
52
	Event.Name = "UserInput_Event"
53
	Event.OnServerEvent:Connect(function(plr,io)
54
	    if plr~=RealPlayer then return end
55
		FakeMouse.Target = io.Target
56
		FakeMouse.Hit = io.Hit
57
		if not io.isMouse then
58
			local b = io.UserInputState == Enum.UserInputState.Begin
59
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
60
				return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
61
			end
62
			if io.UserInputType == Enum.UserInputType.MouseButton2 then
63
				return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
64
			end
65
			for _,t in pairs(CAS.Actions) do
66
				for _,k in pairs(t.Keys) do
67
					if k==io.KeyCode then
68
						t.Function(t.Name,io.UserInputState,io)
69
					end
70
				end
71
			end
72
			FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
73
			UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
74
	    end
75
	end)
76
	Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
77
	local Mouse = owner:GetMouse()
78
	local UIS = game:GetService("UserInputService")
79
	local input = function(io,RobloxHandled)
80
		if RobloxHandled then return end
81
		--Since InputObject is a client-side instance, we create and pass table instead
82
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
83
	end
84
	UIS.InputBegan:Connect(input)
85
	UIS.InputEnded:Connect(input)
86
	local h,t
87
	--Give the server mouse data every second frame, but only if the values changed
88
	--If player is not moving their mouse, client won't fire events
89
	local HB = game:GetService("RunService").Heartbeat
90
	while true do
91
		if h~=Mouse.Hit or t~=Mouse.Target then
92
			h,t=Mouse.Hit,Mouse.Target
93
			Event:FireServer({isMouse=true,Target=t,Hit=h})
94
		end
95
		--Wait 2 frames
96
		for i=1,2 do
97
			HB:Wait()
98
		end
99
	end]==],script)
100
101
	----Sandboxed game object that allows the usage of client-side methods and services
102
	--Real game object
103
	local RealGame = game
104
105
	--Metatable for fake service
106
	local FakeService_Metatable = {
107
		__index = function(self,k)
108
			local s = rawget(self,"_RealService")
109
			if s then
110
				return typeof(s[k])=="function"
111
				and function(_,...)return s[k](s,...)end or s[k]
112
			end
113
		end,
114
		__newindex = function(self,k,v)
115
			local s = rawget(self,"_RealService")
116
			if s then s[k]=v end
117
		end
118
	}
119
	local function FakeService(t,RealService)
120
		t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
121
		return setmetatable(t,FakeService_Metatable)
122
	end
123
124
	--Fake game object
125
	local FakeGame = {
126
		GetService = function(self,s)
127
			return rawget(self,s) or RealGame:GetService(s)
128
		end,
129
		Players = FakeService({
130
			LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
131
		},"Players"),
132
		UserInputService = FakeService(UIS,"UserInputService"),
133
		ContextActionService = FakeService(CAS,"ContextActionService"),
134
		RunService = FakeService({
135
			_btrs = {},
136
			RenderStepped = RealGame:GetService("RunService").Heartbeat,
137
			BindToRenderStep = function(self,name,_,fun)
138
				self._btrs[name] = self.Heartbeat:Connect(fun)
139
			end,
140
			UnbindFromRenderStep = function(self,name)
141
				self._btrs[name]:Disconnect()
142
			end,
143
		},"RunService")
144
	}
145
	rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
146
	FakeGame.service = FakeGame.GetService
147
	FakeService(FakeGame,game)
148
	--Changing owner to fake player object to support owner:GetMouse()
149
	game,owner = FakeGame,FakeGame.Players.LocalPlayer
150
end
151
local plr = game.Players.LocalPlayer
152
local uis = game:GetService("UserInputService")
153
repeat
154
  wait()
155
until plr.Character and plr.Character:WaitForChild("Torso") and plr.Character:WaitForChild("Humanoid")
156
local char = plr.Character
157
char:findFirstChild("Animate"):Destroy()
158
local torso = char.Torso
159
local humanoid = char.Humanoid
160
humanoid.Animator:Destroy()
161
local charStats = Instance.new("Folder", char)
162
charStats.Name = "CharStats"
163
speed = Instance.new("NumberValue", charStats)
164
speed.Name = "Speed"
165
speed.Value = 10
166
local Anim
167
LS = torso["Left Shoulder"]
168
LH = torso["Left Hip"]
169
RS = torso["Right Shoulder"]
170
RH = torso["Right Hip"]
171
Neck = torso.Neck
172
it = Instance.new
173
vt = Vector3.new
174
cf = CFrame.new
175
euler = CFrame.fromEulerAnglesXYZ
176
angles = CFrame.Angles
177
necko = cf(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
178
necko2 = cf(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
179
LHC0 = cf(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
180
LHC1 = cf(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
181
RHC0 = cf(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
182
RHC1 = cf(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
183
RootPart = char.HumanoidRootPart
184
RootJoint = RootPart.RootJoint
185
RootCF = euler(-1.57, 0, 3.14)
186
player = nil
187
RSH, LSH = nil, nil
188
RW, LW = Instance.new("Weld"), Instance.new("Weld")
189
RW.Name = "Right Shoulder"
190
LW.Name = "Left Shoulder"
191
Sheathed = true
192
SwordStance = false
193
Charge = 0
194
RSH = char.Torso["Right Shoulder"]
195
LSH = char.Torso["Left Shoulder"]
196
RSH.Parent = nil
197
LSH.Parent = nil
198
RW.Name = "Right Shoulder"
199
RW.Part0 = char.Torso
200
RW.C0 = cf(1.5, 0.5, 0)
201
RW.C1 = cf(0, 0.5, 0)
202
RW.Part1 = char["Right Arm"]
203
RW.Parent = char.Torso
204
LW.Name = "Left Shoulder"
205
LW.Part0 = char.Torso
206
LW.C0 = cf(-1.5, 0.5, 0)
207
LW.C1 = cf(0, 0.5, 0)
208
LW.Part1 = char["Left Arm"]
209
LW.Parent = char.Torso
210
local cam = workspace.CurrentCamera
211
canTaunt = false
212
local Effects = Instance.new("Model", char)
213
Effects.Name = "Effects"
214
function basicDamage(vhum, damage, colour)
215
  if not vhum or not vhum.Parent:findFirstChild("Humanoid") then
216
    return
217
  end
218
  vhum.Parent.Humanoid:TakeDamage(damage)
219
  local damagepart = Instance.new("Part", Effects)
220
  damagepart.Transparency = 1
221
  damagepart.Anchored = true
222
  damagepart.CanCollide = false
223
  damagepart.Size = Vector3.new(1, 1, 1)
224
  damagepart.Name = "DamagePart"
225
  damagepart.CFrame = vhum.Parent.Head.CFrame * CFrame.new(0, 1, 0)
226
  local g = Instance.new("BillboardGui", damagepart)
227
  g.Enabled = true
228
  g.Adornee = damagepart
229
  g.Size = UDim2.new(5, 0, 5, 0)
230
  g.ExtentsOffset = Vector3.new(0, 0, 0)
231
  g.StudsOffset = Vector3.new(0, 0, 0)
232
  local t = Instance.new("TextLabel", g)
233
  t.BackgroundTransparency = 1
234
  t.Font = "ArialBold"
235
  t.TextSize = 24
236
  t.Text = "-" .. round(damage)
237
  if round(damage) % 1 == 0 then
238
    t.Text = "-" .. round(damage) .. ".0"
239
  end
240
  t.Size = UDim2.new(1, 0, 1, 0)
241
  t.TextStrokeTransparency = 0
242
  t.TextTransparency = 0
243
  t.TextScaled = true
244
  t.TextWrapped = true
245
  t.TextXAlignment = "Center"
246
  t.TextYAlignment = "Center"
247
  t.TextColor3 = colour
248
  coroutine.resume(coroutine.create(function()
249
    for i = 1, 50 do
250
      game:GetService("RunService").Heartbeat:wait()
251
      local sinewave = math.sin(i / 500) * 4
252
      damagepart.CFrame = damagepart.CFrame * CFrame.new(Vector3.new(0, 0.3 - sinewave, 0))
253
      t.TextTransparency = t.TextTransparency + 0.02
254
      t.TextStrokeTransparency = t.TextTransparency + 0.02
255
    end
256
    damagepart:Destroy()
257
  end), t)
258
end
259
humanoid.WalkSpeed = 16
260
mouse = plr:GetMouse()
261
sinecount, normcount, tweentick, tweenrot, tweenrotm = 0, 0, 0, 0, 0
262
partEffects, AttackHas, AttackNeeded, AttackCan = {}, {}, {}, {}
263
AttackHas[1], AttackHas[2], AttackHas[3], AttackHas[4] = 1, 1, 1, 1
264
AttackNeeded[1], AttackNeeded[2], AttackNeeded[3], AttackNeeded[4] = 1, 1, 1, 1
265
AttackCan[1], AttackCan[2], AttackCan[3], AttackCan[4] = true, true, true, true
266
Attack1Get = 0.004
267
Attack2Get = 0.003
268
Attack3Get = 0.0025
269
Attack4Get = 0.001
270
local key1db = false
271
local key2db = false
272
local key3db = false
273
local key4db = false
274
local attacking = Instance.new("BoolValue", charStats)
275
attacking.Name = "Attacking"
276
attacking.Value = false
277
local Energy = Instance.new("NumberValue", charStats)
278
Energy.Name = "EnergyAmount"
279
Energy.Value = math.huge
280
local Attack1Energy = 0--75
281
local Attack2Energy = 0--50
282
local Attack3Energy = 0--50
283
local Attack4Energy = 0--100
284
function rayCast(Pos, Dir, Max, Ignore)
285
  return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
286
end
287
function thread(f)
288
  coroutine.resume(coroutine.create(f))
289
end
290
ArtificialHB = Instance.new("BindableEvent", script)
291
ArtificialHB.Name = "Heartbeat"
292
script:WaitForChild("Heartbeat")
293
frame = 0.025
294
tf = 0
295
allowframeloss = true
296
tossremainder = false
297
lastframe = tick()
298
script.Heartbeat:Fire()
299
game:GetService("RunService").Heartbeat:connect(function(s, p)
300
  tf = tf + s
301
  if tf >= frame then
302
    if allowframeloss then
303
      script.Heartbeat:Fire()
304
      lastframe = tick()
305
    else
306
      for i = 1, math.floor(tf / frame) do
307
        script.Heartbeat:Fire()
308
      end
309
      lastframe = tick()
310
    end
311
    if tossremainder then
312
      tf = 0
313
    else
314
      tf = tf - frame * math.floor(tf / frame)
315
    end
316
  end
317
end)
318
function swait(num)
319
  if num == 0 or num == nil then
320
    ArtificialHB.Event:wait()
321
  else
322
    for i = 0, num do
323
      ArtificialHB.Event:wait()
324
    end
325
  end
326
end
327
function sound(id, par, vol, dur, pit)
328
  coroutine.resume(coroutine.create(function()
329
    local sou = Instance.new("Sound", par or workspace)
330
    sou.Volume = vol
331
    sou.Pitch = pit or 1
332
    sou.SoundId = "http://www.roblox.com/asset/?id=" .. id
333
    swait()
334
    sou:play()
335
    wait(dur)
336
    sou:Destroy()
337
  end))
338
end
339
function clerp(a, b, t)
340
  local qa = {
341
    QuaternionFromCFrame(a)
342
  }
343
  local qb = {
344
    QuaternionFromCFrame(b)
345
  }
346
  local ax, ay, az = a.x, a.y, a.z
347
  local bx, by, bz = b.x, b.y, b.z
348
  local _t = 1 - t
349
  return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
350
end
351
function QuaternionFromCFrame(cf)
352
  local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
353
  local trace = m00 + m11 + m22
354
  if trace > 0 then
355
    local s = math.sqrt(1 + trace)
356
    local recip = 0.5 / s
357
    return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
358
  else
359
    local i = 0
360
    if m00 < m11 then
361
      i = 1
362
    end
363
    if m22 > (i == 0 and m00 or m11) then
364
      i = 2
365
    end
366
    if i == 0 then
367
      local s = math.sqrt(m00 - m11 - m22 + 1)
368
      local recip = 0.5 / s
369
      return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
370
    elseif i == 1 then
371
      local s = math.sqrt(m11 - m22 - m00 + 1)
372
      local recip = 0.5 / s
373
      return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
374
    elseif i == 2 then
375
      local s = math.sqrt(m22 - m00 - m11 + 1)
376
      local recip = 0.5 / s
377
      return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
378
    end
379
  end
380
end
381
function QuaternionToCFrame(px, py, pz, x, y, z, w)
382
  local xs, ys, zs = x + x, y + y, z + z
383
  local wx, wy, wz = w * xs, w * ys, w * zs
384
  local xx = x * xs
385
  local xy = x * ys
386
  local xz = x * zs
387
  local yy = y * ys
388
  local yz = y * zs
389
  local zz = z * zs
390
  return CFrame.new(px, py, pz, 1 - (yy + zz), xy - wz, xz + wy, xy + wz, 1 - (xx + zz), yz - wx, xz - wy, yz + wx, 1 - (xx + yy))
391
end
392
function QuaternionSlerp(a, b, t)
393
  local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
394
  local startInterp, finishInterp
395
  if cosTheta >= 1.0E-4 then
396
    if 1 - cosTheta > 1.0E-4 then
397
      local theta = math.acos(cosTheta)
398
      local invSinTheta = 1 / math.sin(theta)
399
      startInterp = math.sin((1 - t) * theta) * invSinTheta
400
      finishInterp = math.sin(t * theta) * invSinTheta
401
    else
402
      startInterp = 1 - t
403
      finishInterp = t
404
    end
405
  elseif 1 + cosTheta > 1.0E-4 then
406
    local theta = math.acos(-cosTheta)
407
    local invSinTheta = 1 / math.sin(theta)
408
    startInterp = math.sin((t - 1) * theta) * invSinTheta
409
    finishInterp = math.sin(t * theta) * invSinTheta
410
  else
411
    startInterp = t - 1
412
    finishInterp = t
413
  end
414
  return a[1] * startInterp + b[1] * finishInterp, a[2] * startInterp + b[2] * finishInterp, a[3] * startInterp + b[3] * finishInterp, a[4] * startInterp + b[4] * finishInterp
415
end
416
function magic(type, thing)
417
  local magicBlock = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay, t)
418
    local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
419
    prt.CFrame = cframe
420
    local msh = mesh("BlockMesh", prt, nil, nil, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
421
    game:GetService("Debris"):AddItem(prt, 8)
422
    if t == 1 or t == nil then
423
      table.insert(partEffects, {
424
        prt,
425
        "Block1",
426
        delay,
427
        x3,
428
        y3,
429
        z3,
430
        msh
431
      })
432
    elseif t == 2 then
433
      table.insert(partEffects, {
434
        prt,
435
        "Block2",
436
        delay,
437
        x3,
438
        y3,
439
        z3,
440
        msh
441
      })
442
    end
443
  end
444
  local magicCylinder = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
445
    local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
446
    local msh = mesh("CylinderMesh", prt, nil, nil, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
447
    game:GetService("Debris"):AddItem(prt, 8)
448
    table.insert(partEffects, {
449
      prt,
450
      "Cylinder",
451
      delay,
452
      x3,
453
      y3,
454
      z3,
455
      msh
456
    })
457
  end
458
  local magicSphere = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
459
    local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
460
    local msh = mesh("SpecialMesh", prt, "Sphere", nil, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
461
    game:GetService("Debris"):AddItem(prt, 8)
462
    table.insert(partEffects, {
463
      prt,
464
      "Cylinder",
465
      delay,
466
      x3,
467
      y3,
468
      z3,
469
      msh
470
    })
471
  end
472
  local magicRing = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
473
    local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", "SmoothPlastic", cframe)
474
    prt.Anchored = true
475
    prt.CFrame = cframe
476
    local msh = mesh("SpecialMesh", prt, "FileMesh", 3270017, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
477
    game:GetService("Debris"):AddItem(prt, 2)
478
    coroutine.resume(coroutine.create(function(Part, Mesh, num)
479
      for i = 0, 1, delay do
480
        swait()
481
        Part.Transparency = i
482
        Mesh.Scale = Mesh.Scale + Vector3.new(x3, y3, z3)
483
      end
484
      Part:Destroy()
485
    end), prt, msh, (math.random(0, 1) + math.random()) / 5)
486
  end
487
  local magicSlash = function(par, brick, cframe, x1, y1, z1, x3, y3, z3, delay)
488
    local prt = newPart(par, brick, 0, true, false, Vector3.new(), "Part", cframe)
489
    prt.Anchored = true
490
    prt.CFrame = cframe
491
    local msh = mesh("SpecialMesh", prt, "FileMesh", 20329976, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
492
    game:GetService("Debris"):AddItem(prt, 2)
493
    coroutine.resume(coroutine.create(function(Part, Mesh, num)
494
      for i = 0, 1, delay do
495
        swait()
496
        Part.Transparency = i
497
        Mesh.Scale = Mesh.Scale + Vector3.new(x3, y3, z3)
498
      end
499
      Part:Destroy()
500
    end), prt, msh, (math.random(0, 1) + math.random()) / 5)
501
  end
502
  local par = thing[1]
503
  local brick = thing[2]
504
  local cframe = thing[3]
505
  local x1 = thing[4]
506
  local y1 = thing[5]
507
  local z1 = thing[6]
508
  local x3 = thing[7]
509
  local y3 = thing[8]
510
  local z3 = thing[9]
511
  local delay = thing[10]
512
  local t = thing[11]
513
  if type == "Block" or type == 1 then
514
    magicBlock(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
515
  elseif type == "Cylinder" or type == 2 then
516
    magicCylinder(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
517
  elseif type == "Sphere" or type == 3 then
518
    magicSphere(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
519
  elseif type == "Ring" or type == 4 then
520
    magicRing(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
521
  elseif type == "Slash" or type == 5 then
522
    magicSlash(thing[1], thing[2], thing[3], thing[4], thing[5], thing[6], thing[7], thing[8], thing[9], thing[10], thing[11])
523
  end
524
end
525
function randomangles()
526
  local random = math.rad((math.random() - 0.5) * 180)
527
  local randomangles = CFrame.Angles(random, random, random)
528
  return randomangles
529
end
530
function round(num)
531
  local a, b = math.modf(num)
532
  if num % 1 ~= 0 then
533
    return math.floor(num) + math.floor(b * 10 + 0.5) / 10
534
  else
535
    return math.floor(num)
536
  end
537
end
538
function NoOutline(Part)
539
  Part.TopSurface, Part.BottomSurface, Part.LeftSurface, Part.RightSurface, Part.FrontSurface, Part.BackSurface = 10, 10, 10, 10, 10, 10
540
end
541
function newPart(parent, brickcolor, transparency, anchored, cancollide, size, name)
542
  local fp = Instance.new("Part")
543
  fp.Parent = parent
544
  fp.Transparency = transparency
545
  fp.Anchored = anchored
546
  fp.CanCollide = cancollide
547
  fp.Locked = true
548
  fp.BrickColor = brickcolor
549
  fp.Name = name
550
  fp.Size = size
551
  fp.Position = torso.Position
552
  NoOutline(fp)
553
  fp.Material = "SmoothPlastic"
554
  fp:BreakJoints()
555
  return fp
556
end
557
function mesh(Mesh, part, meshtype, meshid, offset, scale)
558
  local mesh = Instance.new(Mesh)
559
  mesh.Parent = part
560
  if Mesh == "SpecialMesh" then
561
    mesh.MeshType = meshtype
562
    if meshid then
563
      mesh.MeshId = "http://www.roblox.com/asset/?id=" .. meshid
564
    end
565
  end
566
  if offset then
567
    mesh.Offset = offset
568
  end
569
  mesh.Scale = scale
570
  return mesh
571
end
572
function weld(parent, part0, part1, c0)
573
  local weld = Instance.new("Weld")
574
  weld.Parent = parent
575
  weld.Part0 = part0
576
  weld.Part1 = part1
577
  weld.C0 = c0
578
  return weld
579
end
580
function findCloseHumanoid(centre, distance)
581
  local tab = {}
582
  for _, child in pairs(game.Workspace:GetChildren()) do
583
    if child:findFirstChild("Humanoid") and child:findFirstChild("Humanoid") ~= humanoid and child:findFirstChild("Torso") then
584
      local vtors = child.Torso
585
      local mag = math.abs((vtors.Position - centre).magnitude)
586
      if distance >= mag then
587
        table.insert(tab, child.Humanoid)
588
      end
589
    end
590
  end
591
  return tab
592
end
593
--[[
594
sftorso = script.Parent.SFTorso:Clone()
595
sftorso.Parent = char
596
sftorso.Name = "SFTorso"
597
armr = script.Parent.SFArm:Clone()
598
armr.Parent = char
599
armr.Name = "SFArmR"
600
arml = script.Parent.SFArm:Clone()
601
arml.Parent = char
602
arml.Name = "SFArmL"
603
weld(torso, sftorso.Handle, torso, CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(90), 0))
604
weld(char["Right Arm"], armr.Handle, char["Right Arm"], CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(-90), 0))
605
weld(char["Left Arm"], arml.Handle, char["Left Arm"], CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(90), 0))
606
]]
607
function attackone()
608
  attacking.Value = true
609
  for i = 0, 1, 0.1 do
610
    swait()
611
    Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(5), math.rad(0), math.rad(90)), 0.3)
612
    RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(0), 0, math.rad(-90)), 0.3)
613
    RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.4, -0.6) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-70)), 0.2)
614
    RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
615
    LW.C0 = clerp(LW.C0, CFrame.new(-1.5, -0.1, -0.2) * CFrame.Angles(math.rad(170), math.rad(-45), 0), 0.3)
616
    LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
617
    RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(105), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
618
    LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), -math.rad(60), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
619
  end
620
  local p0 = newPart(Effects, BrickColor.new("Institutional white"), 0.1, true, false, Vector3.new(1, 1, 1), "Part")
621
  p0.CFrame = RootPart.CFrame * CFrame.new(0, 0, -5)
622
  p0.Material = "Neon"
623
  local m0 = mesh("SpecialMesh", p0, "FileMesh", "1051557", nil, Vector3.new(3, 3, 3))
624
  local p1 = newPart(Effects, BrickColor.new("Bright red"), 0, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
625
  p1.CFrame = RootPart.CFrame * CFrame.new(0, 0, -5)
626
  p1.Material = "Neon"
627
  local m1 = mesh("SpecialMesh", p1, "Sphere", nil, nil, Vector3.new(15, 15, 15))
628
  local p2 = newPart(Effects, BrickColor.new("Lily white"), 0.1, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
629
  p2.CFrame = RootPart.CFrame * CFrame.new(0, 0, -5)
630
  p2.Material = "SmoothPlastic"
631
  local m2 = mesh("SpecialMesh", p2, "Sphere", nil, nil, Vector3.new(16, 16, 16))
632
  weld(p1, p0, p1, CFrame.new(0, 0, 0))
633
  weld(p1, p2, p1, CFrame.new(0, 0, 0))
634
  local now = RootPart.CFrame * CFrame.new(0, 0, -5)
635
  thread(function()
636
    for i = 1, 20 do
637
      swait()
638
      m0.Scale = m0.Scale + Vector3.new(1, 1, 1)
639
      p0.Transparency = p0.Transparency + 0.05
640
      p0.CFrame = now * CFrame.Angles(0, math.rad(15 * i), 0)
641
      m1.Scale = m1.Scale + Vector3.new(1, 1, 1)
642
      p1.Transparency = p1.Transparency + 0.05
643
      p1.CFrame = now
644
      m2.Scale = m2.Scale + Vector3.new(1, 1, 1)
645
      p2.Transparency = p2.Transparency + 0.05
646
      p2.CFrame = now
647
    end
648
    p0:Destroy()
649
    p1:Destroy()
650
    p2:Destroy()
651
  end)
652
  for i, v in pairs(findCloseHumanoid(now.p, 12)) do
653
    basicDamage(v, 8, BrickColor.new("Maroon").Color)
654
    delay(0.1, function()
655
      --basic.Burn(Effects, v, 3, BrickColor.new("Bright red").Color, math.random(2, 4))
656
    end)
657
  end
658
  sound(231917833, torso, 0.5, 5)
659
  for i = 0, 1, 0.08 do
660
    swait()
661
    Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(0), math.rad(10), math.rad(-80)), 0.3)
662
    RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(20), 0, math.rad(80)), 0.3)
663
    RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.5, -0.4) * CFrame.Angles(math.rad(160), math.rad(0), math.rad(60)) * CFrame.Angles(0, math.rad(90), 0), 0.3)
664
    RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
665
    LW.C0 = clerp(LW.C0, CFrame.new(-1.5, -0.1, -0.2) * CFrame.Angles(math.rad(170), math.rad(-45), 0), 0.3)
666
    LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
667
    RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(105), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
668
    LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), -math.rad(60), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
669
  end
670
  wait(0.2)
671
  attacking.Value = false
672
end
673
function attacktwo()
674
  attacking.Value = true
675
  for i = 0, 1, 0.1 do
676
    swait()
677
    Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(5), math.rad(0), math.rad(-90)), 0.3)
678
    RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(0), 0, math.rad(90)), 0.3)
679
    RW.C0 = clerp(RW.C0, CFrame.new(1.5, -0.1, 0) * CFrame.Angles(math.rad(160), math.rad(45), 0), 0.2)
680
    RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
681
    LW.C0 = clerp(LW.C0, CFrame.new(-1.5, -0.1, -0.2) * CFrame.Angles(math.rad(90), math.rad(-45), 0), 0.2)
682
    LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
683
    RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(105), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.2)
684
    LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), -math.rad(60), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
685
  end
686
  local p0 = newPart(Effects, BrickColor.new("Institutional white"), 0.1, true, false, Vector3.new(1, 1, 1), "Part")
687
  p0.CFrame = RootPart.CFrame * CFrame.new(0, 0, -5)
688
  p0.Material = "Neon"
689
  local m0 = mesh("SpecialMesh", p0, "FileMesh", "1051557", nil, Vector3.new(3, 3, 3))
690
  local p1 = newPart(Effects, BrickColor.new("Bright red"), 0, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
691
  p1.CFrame = RootPart.CFrame * CFrame.new(0, 0, -5)
692
  p1.Material = "Neon"
693
  local m1 = mesh("SpecialMesh", p1, "Sphere", nil, nil, Vector3.new(15, 15, 15))
694
  local p2 = newPart(Effects, BrickColor.new("Lily white"), 0.1, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
695
  p2.CFrame = RootPart.CFrame * CFrame.new(0, 0, -5)
696
  p2.Material = "SmoothPlastic"
697
  local m2 = mesh("SpecialMesh", p2, "Sphere", nil, nil, Vector3.new(16, 16, 16))
698
  weld(p1, p0, p1, CFrame.new(0, 0, 0))
699
  weld(p1, p2, p1, CFrame.new(0, 0, 0))
700
  local now = RootPart.CFrame * CFrame.new(0, 0, -5)
701
  thread(function()
702
    for i = 1, 20 do
703
      swait()
704
      m0.Scale = m0.Scale + Vector3.new(1, 1, 1)
705
      p0.Transparency = p0.Transparency + 0.05
706
      p0.CFrame = now * CFrame.Angles(0, math.rad(15 * i), 0)
707
      m1.Scale = m1.Scale + Vector3.new(1, 1, 1)
708
      p1.Transparency = p1.Transparency + 0.05
709
      p1.CFrame = now
710
      m2.Scale = m2.Scale + Vector3.new(1, 1, 1)
711
      p2.Transparency = p2.Transparency + 0.05
712
      p2.CFrame = now
713
    end
714
    p0:Destroy()
715
    p1:Destroy()
716
    p2:Destroy()
717
  end)
718
  for i, v in pairs(findCloseHumanoid(now.p, 12)) do
719
    basicDamage(v, 8, BrickColor.new("Maroon").Color)
720
    delay(0.1, function()
721
      --basic.Burn(Effects, v, 3, BrickColor.new("Bright red").Color, math.random(2, 4))
722
    end)
723
  end
724
  sound(231917833, torso, 0.5, 5, 1.2)
725
  for i = 0, 1, 0.1 do
726
    swait()
727
    Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(0), math.rad(10), math.rad(80)), 0.3)
728
    if i < 0.3 then
729
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(20), 0, math.rad(-80)), 0.3)
730
    else
731
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(20), 0, math.rad(-140)), 0.3)
732
    end
733
    RW.C0 = clerp(RW.C0, CFrame.new(1.5, -0.1, 0) * CFrame.Angles(math.rad(160), math.rad(45), 0), 0.2)
734
    RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
735
    LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, -0.2) * CFrame.Angles(math.rad(90), math.rad(-45), 0), 0.2)
736
    LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
737
    RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(105), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
738
    LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), -math.rad(60), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
739
  end
740
  wait(0.2)
741
  attacking.Value = false
742
end
743
function attackthree()
744
  attacking.Value = true
745
  for i = 0, 1.1, 0.1 do
746
    Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(15), 0, math.rad(0)), 0.14)
747
    RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(0.05, 0, math.rad(0)), 0.14)
748
    LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, -0.5) * CFrame.Angles(math.rad(90), 0, math.rad(50)), 0.14)
749
    LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0), 0.14)
750
    RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.5, -0.5) * CFrame.Angles(math.rad(90), 0, math.rad(-50)), 0.14)
751
    RW.C1 = clerp(RW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.14)
752
    swait()
753
  end
754
  local p0 = newPart(Effects, BrickColor.new("Institutional white"), 0.1, true, false, Vector3.new(1, 1, 1), "Part")
755
  p0.CFrame = RootPart.CFrame * CFrame.new(0, 0, -7)
756
  p0.Material = "Neon"
757
  local m0 = mesh("SpecialMesh", p0, "FileMesh", "1051557", nil, Vector3.new(6, 6, 6))
758
  local pc = p0:Clone()
759
  local p1 = newPart(Effects, BrickColor.new("Bright red"), 0, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
760
  p1.CFrame = RootPart.CFrame * CFrame.new(0, 0, -7)
761
  p1.Material = "Neon"
762
  local m1 = mesh("SpecialMesh", p1, "Sphere", nil, nil, Vector3.new(30, 30, 30))
763
  local p2 = newPart(Effects, BrickColor.new("Bright red"), 0.1, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
764
  p2.CFrame = RootPart.CFrame * CFrame.new(0, 0, -7)
765
  p2.Material = "Neon"
766
  local m2 = mesh("SpecialMesh", p2, "Sphere", nil, nil, Vector3.new(32, 32, 32))
767
  thread(function()
768
    local now = RootPart.CFrame * CFrame.new(0, 0, -7)
769
    for i = 1, 50 do
770
      swait()
771
      local sinewave = math.sin(i * math.pi / 100)
772
      p0.CFrame = now * CFrame.new(0, 0, -sinewave * 12) * CFrame.Angles(0, math.rad(10 * i), 0)
773
      p1.CFrame = now * CFrame.new(0, 0, -sinewave * 12)
774
      p2.CFrame = now * CFrame.new(0, 0, -sinewave * 12)
775
      if i % 12 == 0 then
776
        do
777
          local cnow = p0.CFrame
778
          for i, v in pairs(findCloseHumanoid(cnow.p, 17)) do
779
            basicDamage(v, math.random(2, 5), BrickColor.new("Really red").Color)
780
          end
781
          local pc = pc:Clone()
782
          pc.CFrame = cnow
783
          pc.Parent = Effects
784
          thread(function()
785
            for i = 1, 20 do
786
              swait()
787
              pc.Mesh.Scale = pc.Mesh.Scale + Vector3.new(1, 1, 1)
788
              pc.Transparency = pc.Transparency + 0.05
789
              pc.CFrame = cnow
790
            end
791
            pc:Destroy()
792
          end)
793
        end
794
      end
795
      if i >= 30 then
796
        p0.Transparency = p0.Transparency + 0.05
797
        p1.Transparency = p1.Transparency + 0.05
798
        p2.Transparency = p2.Transparency + 0.05
799
        m0.Scale = m0.Scale + Vector3.new(1, 1, 1)
800
        m1.Scale = m1.Scale + Vector3.new(1, 1, 1)
801
        m2.Scale = m2.Scale + Vector3.new(1, 1, 1)
802
      end
803
    end
804
    p0:Destroy()
805
    p1:Destroy()
806
    p2:Destroy()
807
  end)
808
  sound(300916038, torso, 0.5, 5)
809
  for i = 0, 1.1, 0.05 do
810
    Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(10), 0, math.rad(0)), 0.14)
811
    RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(-0.05, 0, math.rad(0)), 0.14)
812
    LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0.15) * CFrame.Angles(math.rad(90), 0, math.rad(-80)), 0.14)
813
    LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(math.rad(0), 0, 0), 0.14)
814
    RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0.15) * CFrame.Angles(math.rad(90), 0, math.rad(80)), 0.14)
815
    RW.C1 = clerp(RW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.14)
816
    RH.C0 = clerp(RH.C0, CFrame.new(1, -0.98, -0.2) * CFrame.Angles(-0.2, math.rad(90), 0), 0.14)
817
    LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(0, -math.rad(90), 0), 0.14)
818
    swait()
819
  end
820
  wait(0.4)
821
  attacking.Value = false
822
end
823
counter = 0
824
uis.InputBegan:connect(function(key, Global)
825
  if Global then
826
    return
827
  end
828
  if attacking.Value == true then
829
    return
830
  end
831
  if key.UserInputType == Enum.UserInputType.MouseButton1 then
832
    if attacking.Value == true then
833
      return
834
    end
835
    if counter == 0 then
836
      attackone()
837
      counter = 1
838
    elseif counter == 1 then
839
      attacktwo()
840
      counter = 2
841
    elseif counter == 2 then
842
      attackthree()
843
      counter = 0
844
    end
845
  end
846
  if key.KeyCode == Enum.KeyCode.Q then
847
    if AttackHas[1] < AttackNeeded[1] or Energy.Value < Attack1Energy then
848
      return
849
    end
850
    Energy.Value = Energy.Value - Attack1Energy
851
    AttackHas[1] = 0
852
    AttackCan[1] = false
853
    attacking.Value = true
854
    for i = 0, 1, 0.05 do
855
      swait()
856
      Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(0.1, 0, math.rad(-45)), 0.3)
857
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(-0.1, 0, math.rad(45)), 0.3)
858
      RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(1.57, 0, 0), 0.3)
859
      RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
860
      LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(0, 0, -1.57), 0.3)
861
      LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
862
      RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(0, math.rad(90), 0), 0.3)
863
      LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(0, -math.rad(90), 0), 0.3)
864
    end
865
    local nancount = 0
866
    for i = 0, 3, 0.05 do
867
      nancount = nancount + 1
868
      if nancount % 10 == 0 then
869
        sound(231917888, torso, 0.5, 4)
870
        do
871
          local p0 = newPart(Effects, BrickColor.new("Institutional white"), 0.1, true, false, Vector3.new(1, 1, 1), "Part")
872
          p0.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
873
          p0.Material = "Neon"
874
          local m0 = mesh("SpecialMesh", p0, "FileMesh", "1051557", nil, Vector3.new(3, 3, 3))
875
          local p1 = newPart(Effects, BrickColor.new("Bright red"), 0, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
876
          p1.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
877
          p1.Material = "Neon"
878
          local m1 = mesh("SpecialMesh", p1, "Sphere", nil, nil, Vector3.new(30, 30, 30))
879
          local p2 = newPart(Effects, BrickColor.new("Lily white"), 0.1, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
880
          p2.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
881
          p2.Material = "SmoothPlastic"
882
          local m2 = mesh("SpecialMesh", p2, "Sphere", nil, nil, Vector3.new(31, 31, 31))
883
          weld(p1, p0, p1, CFrame.new(0, 0, 0))
884
          weld(p1, p2, p1, CFrame.new(0, 0, 0))
885
          local now = RootPart.CFrame * CFrame.new(0, 0, 0)
886
          thread(function()
887
            for i = 1, 20 do
888
              swait()
889
              m0.Scale = m0.Scale + Vector3.new(1, 1, 1)
890
              p0.Transparency = p0.Transparency + 0.05
891
              p0.CFrame = now * CFrame.Angles(0, math.rad(15 * i), 0)
892
              m1.Scale = m1.Scale + Vector3.new(1, 1, 1)
893
              p1.Transparency = p1.Transparency + 0.05
894
              p1.CFrame = now
895
              m2.Scale = m2.Scale + Vector3.new(1, 1, 1)
896
              p2.Transparency = p2.Transparency + 0.05
897
              p2.CFrame = now
898
            end
899
            p0:Destroy()
900
            p1:Destroy()
901
            p2:Destroy()
902
          end)
903
          for i, v in pairs(findCloseHumanoid(now.p, 15)) do
904
            basicDamage(v, 4, BrickColor.new("Maroon").Color)
905
            delay(0.1, function()
906
              --basic.Burn(Effects, v, 1, BrickColor.new("Bright red").Color, math.random(1, 3))
907
            end)
908
          end
909
        end
910
      end
911
      Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(0.1, 0, math.rad(-45)), 0.3)
912
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(0.1, 0, math.rad(45) + 0.1 * -i * 67), 0.3)
913
      RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(1.57, 0, 0.785), 0.3)
914
      RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
915
      LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(-0.785, 0, -1.57), 0.3)
916
      LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
917
      RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(0, math.rad(90), 0), 0.3)
918
      LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(0, -math.rad(90), 0), 0.3)
919
      swait()
920
    end
921
    AttackCan[1] = true
922
    attacking.Value = false
923
  end
924
  if key.KeyCode == Enum.KeyCode.E then
925
    if AttackHas[2] < AttackNeeded[2] or Energy.Value < Attack2Energy then
926
      return
927
    end
928
    Energy.Value = Energy.Value - Attack2Energy
929
    AttackHas[2] = 0
930
    AttackCan[2] = false
931
    attacking.Value = true
932
    for i = 0, 1, 0.05 do
933
      swait()
934
      Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(5), 0, math.rad(0)), 0.15)
935
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(15), 0, math.rad(0)), 0.15)
936
      RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.5, 0.2) * CFrame.Angles(math.rad(90), 0, -math.rad(45)), 0.15)
937
      RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0.2), 0.2)
938
      LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, 0) * CFrame.Angles(math.rad(90), 0, math.rad(45)), 0.15)
939
      LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
940
      RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(15), math.rad(80), 0), 0.15)
941
      LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0.2) * CFrame.Angles(math.rad(15), -math.rad(80), 0), 0.15)
942
    end
943
    do
944
      local p0 = newPart(Effects, BrickColor.new("Institutional white"), 0.1, true, false, Vector3.new(1, 1, 1), "Part")
945
      p0.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
946
      p0.Material = "Neon"
947
      local m0 = mesh("SpecialMesh", p0, "FileMesh", "1051557", nil, Vector3.new(3, 3, 3))
948
      local p1 = newPart(Effects, BrickColor.new("Bright red"), 0, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
949
      p1.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
950
      p1.Material = "Neon"
951
      local m1 = mesh("SpecialMesh", p1, "Sphere", nil, nil, Vector3.new(30, 30, 30))
952
      local p2 = newPart(Effects, BrickColor.new("Lily white"), 0.1, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
953
      p2.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
954
      p2.Material = "SmoothPlastic"
955
      local m2 = mesh("SpecialMesh", p2, "Sphere", nil, nil, Vector3.new(31, 31, 31))
956
      weld(p1, p0, p1, CFrame.new(0, 0, 0))
957
      weld(p1, p2, p1, CFrame.new(0, 0, 0))
958
      local now = RootPart.CFrame * CFrame.new(0, 0, 0)
959
      thread(function()
960
        for i = 1, 40 do
961
          swait()
962
          m0.Scale = m0.Scale + Vector3.new(5, 5, 5)
963
          p0.Transparency = p0.Transparency + 0.025
964
          p0.CFrame = now * CFrame.Angles(0, math.rad(15 * i), 0)
965
          m1.Scale = m1.Scale + Vector3.new(5, 5, 5)
966
          p1.Transparency = p1.Transparency + 0.025
967
          p1.CFrame = now
968
          m2.Scale = m2.Scale + Vector3.new(1, 1, 1)
969
          p2.Transparency = p2.Transparency + 0.025
970
          p2.CFrame = now
971
        end
972
        p0:Destroy()
973
        p1:Destroy()
974
        p2:Destroy()
975
      end)
976
      for i, v in pairs(findCloseHumanoid(torso.Position, 25)) do
977
        do
978
          local enemply = game.Players:GetPlayerFromCharacter(v.Parent)
979
          local baseply = player
980
          if enemply then
981
            if enemply.TeamColor == baseply.TeamColor and enemply.Neutral == false and baseply.Neutral == false then
982
              --basic.Buff(Effects, v, Color3.new(0, 0, 0), "Attack", 0.1, 5)
983
            else
984
              --basic.Burn(Effects, v, 2.5, BrickColor.new("Bright red").Color, math.random(3, 6))
985
              delay(0.5, function()
986
                --basic.Burn(Effects, v, 2.5, BrickColor.new("Bright red").Color, math.random(3, 6))
987
              end)
988
            end
989
          elseif not enemply then
990
            --basic.Burn(Effects, v, 2.5, BrickColor.new("Bright red").Color, math.random(3, 6))
991
            delay(0.5, function()
992
              --basic.Burn(Effects, v, 2.5, BrickColor.new("Bright red").Color, math.random(3, 6))
993
            end)
994
          end
995
        end
996
      end
997
      sound(416103546, torso, 0.5, 5)
998
      for i = 0, 1, 0.05 do
999
        swait()
1000
        Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(15), 0, math.rad(0)), 0.3)
1001
        RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(-15), 0, math.rad(0)), 0.3)
1002
        RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(0, 0, math.rad(100)), 0.3)
1003
        RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1004
        LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(0, 0, math.rad(-100)), 0.3)
1005
        LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1006
        RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(-15), math.rad(80), 0), 0.3)
1007
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0.2) * CFrame.Angles(math.rad(-15), -math.rad(80), 0), 0.3)
1008
      end
1009
      wait(0.1)
1010
      AttackCan[2] = true
1011
      attacking.Value = false
1012
    end
1013
  end
1014
  if key.KeyCode == Enum.KeyCode.R then
1015
    if AttackHas[3] < AttackNeeded[3] or Energy.Value < Attack3Energy then
1016
      return
1017
    end
1018
    Energy.Value = Energy.Value - Attack3Energy
1019
    AttackHas[3] = 0
1020
    AttackCan[3] = false
1021
    attacking.Value = true
1022
    for i = 0, 1, 0.1 do
1023
      swait()
1024
      Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(15), 0, math.rad(0)), 0.15)
1025
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(-15), 0, math.rad(0)), 0.15)
1026
      RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(0, 0, math.rad(100)), 0.15)
1027
      RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1028
      LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(0, 0, math.rad(-100)), 0.15)
1029
      LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1030
      RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(-15), math.rad(80), 0), 0.15)
1031
      LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0.2) * CFrame.Angles(math.rad(-15), -math.rad(80), 0), 0.15)
1032
    end
1033
    for i = 1, 6 do
1034
      do
1035
        local p0 = newPart(Effects, BrickColor.new("Institutional white"), 0.1, false, false, Vector3.new(1, 1, 1), "Part")
1036
        p0.CFrame = RootPart.CFrame * CFrame.new(0, 2, -2)
1037
        p0.Material = "Neon"
1038
        local m0 = mesh("SpecialMesh", p0, "FileMesh", "1051557", nil, Vector3.new(8, 8, 8))
1039
        local bv0 = Instance.new("BodyVelocity", p0)
1040
        bv0.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
1041
        bv0.Velocity = (RootPart.CFrame * CFrame.Angles(0, math.rad(-45 + 11.25 * i), 0)).lookVector * 15
1042
        local bv1 = Instance.new("BodyAngularVelocity", p0)
1043
        bv1.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
1044
        bv1.AngularVelocity = Vector3.new(0, 10, 0)
1045
        p0.Touched:connect(function(hit)
1046
          thread(function()
1047
            if not hit.Parent:findFirstChild("Humanoid") and hit.Parent:findFirstChild("Torso") then
1048
              return
1049
            end
1050
            if hit.Parent.Humanoid == humanoid then
1051
              return
1052
            end
1053
            if hit.Parent:findFirstChild("Vandalism_Hit" .. plr.Name) then
1054
              return
1055
            end
1056
            local bvc = bv0:Clone()
1057
            bvc.Parent = hit.Parent.Torso
1058
            local bvc2 = bv1:Clone()
1059
            bvc2.Parent = hit.Parent.Torso
1060
            local str = Instance.new("StringValue", hit.Parent)
1061
            str.Name = "Vandalism_Hit" .. plr.Name
1062
            sound(240517987, p0, 0.5, 5, 1)
1063
            while p0.Parent == Effects do
1064
              basicDamage(hit.Parent.Humanoid, 3, BrickColor.new("Mid gray").Color)
1065
              wait(0.25)
1066
            end
1067
            bvc:Destroy()
1068
            bvc2:Destroy()
1069
            str:Destroy()
1070
          end)
1071
        end)
1072
        spawn(function()
1073
          wait(3)
1074
          for i = 1, 10 do
1075
            swait()
1076
            p0.Transparency = p0.Transparency + 0.1
1077
          end
1078
          p0:Destroy()
1079
        end)
1080
      end
1081
    end
1082
    for i = 0, 1, 0.05 do
1083
      swait()
1084
      Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(5), 0, math.rad(0)), 0.3)
1085
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(15), 0, math.rad(0)), 0.3)
1086
      RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.5, 0.4) * CFrame.Angles(math.rad(90), 0, -math.rad(0)), 0.3)
1087
      RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0.2), 0.5)
1088
      LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, 0.4) * CFrame.Angles(math.rad(90), 0, math.rad(0)), 0.3)
1089
      LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1090
      RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(15), math.rad(80), 0), 0.3)
1091
      LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0.2) * CFrame.Angles(math.rad(15), -math.rad(80), 0), 0.3)
1092
    end
1093
    AttackCan[3] = true
1094
    attacking.Value = false
1095
  end
1096
  if key.KeyCode == Enum.KeyCode.F then
1097
    if AttackHas[4] < AttackNeeded[4] or Energy.Value < Attack4Energy then
1098
      return
1099
    end
1100
    Energy.Value = Energy.Value - Attack4Energy
1101
    AttackHas[4] = 0
1102
    AttackCan[4] = false
1103
    attacking.Value = true
1104
    for i = 0, 1, 0.05 do
1105
      swait()
1106
      Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(5), math.rad(0), math.rad(90)), 0.1)
1107
      RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(0), 0, math.rad(-90)), 0.1)
1108
      RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.4, -0.6) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(-70)), 0.1)
1109
      RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
1110
      LW.C0 = clerp(LW.C0, CFrame.new(-1.5, -0.1, -0.2) * CFrame.Angles(math.rad(170), math.rad(-45), 0), 0.1)
1111
      LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
1112
      RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(105), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.1)
1113
      LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), -math.rad(60), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.1)
1114
    end
1115
    charStats.Speed.Value = charStats.Speed.Value - 2
1116
    function explode(pos)
1117
      local p0 = newPart(Effects, BrickColor.new("Institutional white"), 0.1, true, false, Vector3.new(1, 1, 1), "Part")
1118
      p0.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
1119
      p0.Material = "Neon"
1120
      local m0 = mesh("SpecialMesh", p0, "FileMesh", "1051557", nil, Vector3.new(3, 3, 3))
1121
      local p1 = newPart(Effects, BrickColor.new("Bright red"), 0, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
1122
      p1.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
1123
      p1.Material = "Neon"
1124
      local m1 = mesh("SpecialMesh", p1, "Sphere", nil, nil, Vector3.new(30, 30, 30))
1125
      local p2 = newPart(Effects, BrickColor.new("Lily white"), 0.1, true, false, Vector3.new(0.2, 0.2, 0.2), "Part")
1126
      p2.CFrame = RootPart.CFrame * CFrame.new(0, 0, 0)
1127
      p2.Material = "SmoothPlastic"
1128
      local m2 = mesh("SpecialMesh", p2, "Sphere", nil, nil, Vector3.new(31, 31, 31))
1129
      weld(p1, p0, p1, CFrame.new(0, 0, 0))
1130
      weld(p1, p2, p1, CFrame.new(0, 0, 0))
1131
      local ref = newPart(Effects, BrickColor.Black(), 1, true, false, Vector3.new(), "Ref")
1132
      sound(231917744, ref, 0.7, 8, 1)
1133
      delay(8, function()
1134
        ref:Destroy()
1135
      end)
1136
      local now = CFrame.new(pos)
1137
      thread(function()
1138
        for i = 1, 40 do
1139
          swait()
1140
          m0.Scale = m0.Scale + Vector3.new(2, 10, 2)
1141
          p0.Transparency = p0.Transparency + 0.025
1142
          p0.CFrame = now * CFrame.Angles(0, math.rad(15 * i), 0)
1143
          m1.Scale = m1.Scale + Vector3.new(10, 10, 10)
1144
          p1.Transparency = p1.Transparency + 0.025
1145
          p1.CFrame = now
1146
          m2.Scale = m2.Scale + Vector3.new(10, 10, 10)
1147
          p2.Transparency = p2.Transparency + 0.025
1148
          p2.CFrame = now
1149
        end
1150
        p0:Destroy()
1151
        p1:Destroy()
1152
        p2:Destroy()
1153
      end)
1154
    end
1155
    do
1156
      local hitpart, pospart = rayCast(RootPart.Position, RootPart.CFrame.lookVector, 30, char)
1157
      local prevpos = RootPart.CFrame.p
1158
      local nowpos = RootPart.CFrame.p
1159
      local rootunit = RootPart.CFrame.lookVector * 1
1160
      local targpos = nowpos + prevpos
1161
      if not pospart then
1162
        RootPart.CFrame = RootPart.CFrame * CFrame.new(0, 0, -40)
1163
        nowpos = RootPart.CFrame * CFrame.new(0, 0, -40)
1164
        nowpos = nowpos.p
1165
        targpos = (nowpos + prevpos) / 2
1166
      elseif hitpart then
1167
        if hitpart.Parent:findFirstChild("Humanoid") then
1168
          RootPart.CFrame = CFrame.new(pospart + rootunit * 40, RootPart.Position + rootunit)
1169
          nowpos = CFrame.new(pospart + rootunit * 40)
1170
          nowpos = nowpos.p
1171
          targpos = (nowpos + prevpos) / 2
1172
        else
1173
          RootPart.CFrame = CFrame.new(pospart + rootunit, RootPart.Position + rootunit)
1174
          nowpos = CFrame.new(pospart)
1175
          nowpos = nowpos.p
1176
          targpos = (nowpos + prevpos) / 2
1177
        end
1178
      else
1179
        RootPart.CFrame = CFrame.new(pospart + rootunit, RootPart.Position + rootunit)
1180
        nowpos = CFrame.new(pospart)
1181
        nowpos = nowpos.p
1182
        targpos = (nowpos + prevpos) / 2
1183
      end
1184
      local mag = math.abs((nowpos - prevpos).magnitude)
1185
      local mid = (nowpos + prevpos) / 2
1186
      local unit = rootunit
1187
      local laser = newPart(nil, BrickColor.new("Bright red"), 0.5, true, false, Vector3.new(), "Laser", "SmoothPlastic")
1188
      local lmsh = mesh("SpecialMesh", laser, "Sphere", nil, Vector3.new(0, 0, 0), Vector3.new(5, 5, 5))
1189
      laser.CFrame = CFrame.new(mid, mid + unit)
1190
      lmsh.Scale = Vector3.new(2, 2, math.abs(mag * 2))
1191
      thread(function()
1192
        for i = 1, 20 do
1193
          swait()
1194
          lmsh.Scale = lmsh.Scale + Vector3.new(0, 0, 4)
1195
        end
1196
        for i = 1, 20 do
1197
          swait()
1198
          lmsh.Scale = lmsh.Scale + Vector3.new(0, 0, 4)
1199
          laser.Transparency = laser.Transparency + 0.05
1200
        end
1201
        laser:Destroy()
1202
      end)
1203
      laser.Parent = Effects
1204
      for i = 0, 1, 0.05 do
1205
        swait()
1206
        Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(0), math.rad(10), math.rad(-80)), 0.3)
1207
        RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(20), 0, math.rad(80)), 0.3)
1208
        RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.5, -0.4) * CFrame.Angles(math.rad(160), math.rad(0), math.rad(60)) * CFrame.Angles(0, math.rad(90), 0), 0.3)
1209
        RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
1210
        LW.C0 = clerp(LW.C0, CFrame.new(-1.5, -0.1, -0.2) * CFrame.Angles(math.rad(170), math.rad(-45), 0), 0.3)
1211
        LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
1212
        RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(105), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
1213
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), -math.rad(60), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.3)
1214
      end
1215
      for i = 0, 1, 0.025 do
1216
        swait()
1217
        Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(15), 0, math.rad(0)), 0.1)
1218
        RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(-10), 0, math.rad(0)), 0.1)
1219
        if i >= 0.4 then
1220
          RW.C0 = clerp(RW.C0, CFrame.new(1.3, 0.5, 0.4) * CFrame.Angles(math.rad(80), math.rad(0), math.rad(100)) * CFrame.Angles(0, math.rad(90), 0), 0.1)
1221
          LW.C0 = clerp(LW.C0, CFrame.new(-1.3, 0.5, 0.4) * CFrame.Angles(math.rad(80), math.rad(0), math.rad(-100)), 0.1)
1222
          if i > 0.4 and i < 0.425 then
1223
            explode(targpos)
1224
            for i, v in pairs(findCloseHumanoid(targpos, 40)) do
1225
              basicDamage(v, 15, BrickColor.new("Maroon").Color)
1226
              delay(0.1, function()
1227
                --basic.Burn(Effects, v, 3, BrickColor.new("Bright red").Color, math.random(5, 10), 0.1)
1228
              end)
1229
            end
1230
          end
1231
        else
1232
          RW.C0 = clerp(RW.C0, CFrame.new(1.2, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(210)), 0.1)
1233
          LW.C0 = clerp(LW.C0, CFrame.new(-1.2, 0.5, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(-210)), 0.1)
1234
        end
1235
        LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.3)
1236
        RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(0), math.rad(105), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.1)
1237
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(0), -math.rad(60), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.1)
1238
      end
1239
      charStats.Speed.Value = charStats.Speed.Value + 2
1240
      AttackCan[4] = true
1241
      attacking.Value = false
1242
    end
1243
  end
1244
end)
1245
thread(function()
1246
  tweentick = 45
1247
  tweenrot = 0.9
1248
  tweenrotm = 0.15
1249
  while true do
1250
    swait()
1251
    sinecount = sinecount + 1
1252
    normcount = normcount + 1
1253
    local sinewave = math.sin(sinecount * 3 / 75) * 0.2
1254
    local function MagicBlock(brickcolor, cframe, x1, y1, z1, x3, y3, z3, delay, Type, parent)
1255
      local function part(formfactor, parent, reflectance, transparency, brickcolor, name, size)
1256
        local fp = Instance.new("Part")
1257
        fp.formFactor = formfactor
1258
        fp.Parent = Effects
1259
        fp.Reflectance = reflectance
1260
        fp.Transparency = transparency
1261
        fp.CanCollide = false
1262
        fp.Locked = true
1263
        fp.BrickColor = brickcolor
1264
        fp.Name = name
1265
        fp.Size = size
1266
        fp.Position = torso.Position
1267
        NoOutline(fp)
1268
        fp.Material = "SmoothPlastic"
1269
        fp:BreakJoints()
1270
        return fp
1271
      end
1272
      local prt = part(3, char, 0, 0, brickcolor, "Effect", Vector3.new())
1273
      prt.Anchored = true
1274
      prt.CFrame = cframe
1275
      local msh = mesh("BlockMesh", prt, "", nil, Vector3.new(0, 0, 0), Vector3.new(x1, y1, z1))
1276
      return prt, msh
1277
    end
1278
    if normcount % 3 == 0 then
1279
      local mb = MagicBlock(BrickColor.new("Really red"), torso.CFrame * CFrame.new(math.random(-3, 3), math.random(-3, -3), math.random(-3, 3)) * CFrame.Angles(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 2, 2, 2, 2, 2, 2, 0.05, 2, Part)
1280
      mb.Material = "Neon"
1281
      local m = mesh("BlockMesh", mb, nil, nil, Vector3.new(0, 0, 0), Vector3.new(1, 1, 1))
1282
      table.insert(partEffects, {
1283
        mb,
1284
        "MoveDisappear",
1285
        0.05,
1286
        0,
1287
        0.1,
1288
        0
1289
      })
1290
    end
1291
    local torvel = (RootPart.Velocity * Vector3.new(1, 0, 1)).magnitude
1292
    local rotvel = RootPart.RotVelocity.Y
1293
    local hitfloor, posfloor = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, char)
1294
    if attacking.Value == false then
1295
      if 1 < RootPart.Velocity.y and hitfloor == nil then
1296
        Anim = "Jump"
1297
        Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(-15), 0, math.rad(0)), 0.1)
1298
        LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, math.rad(12)), 0.2)
1299
        LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
1300
        RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, -math.rad(12)), 0.2)
1301
        RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
1302
        RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(0, 0, 0), 0.2)
1303
        RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(-12), math.rad(90), 0), 0.2)
1304
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(12), -math.rad(90), 0), 0.2)
1305
      elseif RootPart.Velocity.y < -1 and hitfloor == nil then
1306
        Anim = "Fall"
1307
        Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(23), 0, 0), 0.2)
1308
        Neck.C1 = clerp(Neck.C1, necko2 * CFrame.Angles(0, 0, 0), 0.2)
1309
        RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(0, 0, 0), 0.2)
1310
        RW.C0 = clerp(RW.C0, CFrame.new(1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, math.rad(12)), 0.2)
1311
        RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
1312
        LW.C0 = clerp(LW.C0, CFrame.new(-1.5, 0.5, 0) * CFrame.Angles(-math.rad(17), 0, -math.rad(12)), 0.2)
1313
        LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0) * CFrame.Angles(0, 0, 0), 0.2)
1314
        RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.rad(24), math.rad(90), 0), 0.2)
1315
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(-12), -math.rad(90), 0), 0.2)
1316
      elseif torvel < 1 and hitfloor ~= nil then
1317
        Anim = "Idle"
1318
        Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(5), 0, math.rad(20)), 0.1)
1319
        RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.new(0, 0, math.cos(normcount / 45) / 8) * CFrame.Angles(math.rad(0), 0, math.rad(-20)), 0.1)
1320
        RW.C0 = clerp(RW.C0, CFrame.new(1.5, -0.1 + math.cos(normcount / 32) / 8, 0) * CFrame.Angles(math.rad(160), math.rad(45), 0), 0.2)
1321
        RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1322
        LW.C0 = clerp(LW.C0, CFrame.new(-1.5, -0.1 + math.cos(normcount / 32) / 8, -0.2) * CFrame.Angles(math.rad(140), math.rad(-45), 0), 0.2)
1323
        LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1324
        RH.C0 = clerp(RH.C0, CFrame.new(1, -1 - math.cos(normcount / 45) / 8, 0) * CFrame.Angles(math.rad(0), math.rad(95), 0) * CFrame.Angles(math.rad(0), 0, 0), 0.2)
1325
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -1 - math.cos(normcount / 45) / 8, 0) * CFrame.Angles(math.rad(0), -math.rad(80), math.rad(0)) * CFrame.Angles(math.rad(0), 0, 0), 0.2)
1326
      elseif torvel > 1 and hitfloor ~= nil then
1327
        sinewave = sinewave / 10
1328
        Anim = "Walk"
1329
        Neck.C0 = clerp(Neck.C0, necko * CFrame.Angles(math.rad(0), math.rad(5), math.rad(70) + math.rad(rotvel * 4)), 0.1)
1330
        RootJoint.C0 = clerp(RootJoint.C0, RootCF * CFrame.Angles(math.rad(0), math.rad(rotvel * 1), math.rad(-70)), 0.1)
1331
        RW.C0 = clerp(RW.C0, CFrame.new(1.5, -0.1, 0) * CFrame.Angles(math.rad(150), math.rad(45), 0), 0.2)
1332
        RW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1333
        LW.C0 = clerp(LW.C0, CFrame.new(-1.5, -0.1, -0.2) * CFrame.Angles(math.rad(130), math.rad(-45), 0), 0.2)
1334
        LW.C1 = clerp(LW.C1, CFrame.new(0, 0.5, 0), 0.2)
1335
        RH.C0 = clerp(RH.C0, CFrame.new(1, -1, 0) * CFrame.Angles(math.cos(normcount * 1 / 6), math.rad(105), 0), 0.2)
1336
        LH.C0 = clerp(LH.C0, CFrame.new(-1, -1, 0) * CFrame.Angles(-math.cos(normcount * 1 / 6), -math.rad(60), 0), 0.2)
1337
      end
1338
      RootJoint.C0 = clerp(RootJoint.C0, RootJoint.C0 * CFrame.new(0, 0, sinewave / 3), 0.1)
1339
      RW.C0 = clerp(RW.C0, RW.C0 * CFrame.new(0, sinewave / 3, 0), 0.2)
1340
      LW.C0 = clerp(LW.C0, LW.C0 * CFrame.new(0, sinewave / 3, 0), 0.2)
1341
      RH.C0 = clerp(RH.C0, RH.C0 * CFrame.new(0, -sinewave / 3, 0), 0.2)
1342
      LH.C0 = clerp(LH.C0, LH.C0 * CFrame.new(0, -sinewave / 3, 0), 0.2)
1343
    end
1344
    if AttackHas[1] < AttackNeeded[1] and AttackCan[1] == true then
1345
      AttackHas[1] = AttackHas[1] + Attack1Get
1346
    end
1347
    if AttackHas[2] < AttackNeeded[2] and AttackCan[2] == true then
1348
      AttackHas[2] = AttackHas[2] + Attack2Get
1349
    end
1350
    if AttackHas[3] < AttackNeeded[3] and AttackCan[3] == true then
1351
      AttackHas[3] = AttackHas[3] + Attack3Get
1352
    end
1353
    if AttackHas[4] < AttackNeeded[4] and AttackCan[4] == true then
1354
      AttackHas[4] = AttackHas[4] + Attack4Get
1355
    end
1356
--[[
1357
    Re1:TweenSize(UDim2.new(AttackHas[1] / AttackNeeded[1], 0, 1, 0), nil, 1, 0.4)
1358
    Re2:TweenSize(UDim2.new(AttackHas[2] / AttackNeeded[2], 0, 1, 0), nil, 1, 0.4)
1359
    Re3:TweenSize(UDim2.new(AttackHas[3] / AttackNeeded[3], 0, 1, 0), nil, 1, 0.4)
1360
    Re4:TweenSize(UDim2.new(AttackHas[4] / AttackNeeded[4], 0, 1, 0), nil, 1, 0.4)
1361
]]
1362
    for i = 1, #partEffects do
1363
      if partEffects[i] ~= nil then
1364
        local Thing = partEffects[i]
1365
        if Thing ~= nil then
1366
          local Part = Thing[1]
1367
          local Type = Thing[2]
1368
          local Increment = Thing[3]
1369
          local IncX = Thing[4]
1370
          local IncY = Thing[5]
1371
          local IncZ = Thing[6]
1372
          local SizeX = Thing[7]
1373
          local SizeY = Thing[8]
1374
          local SizeZ = Thing[9]
1375
          if 1 >= Part.Transparency then
1376
            if Type == "Disappear" then
1377
              Part.Transparency = Part.Transparency + Increment
1378
            end
1379
            if Type == "MoveDisappear" then
1380
              Part.Transparency = Part.Transparency + Increment
1381
              Part.CFrame = CFrame.new(Part.CFrame.X + IncX, Part.CFrame.Y + IncY, Part.CFrame.Z + IncZ) * randomangles()
1382
            end
1383
            if Type == "MoveBloom" then
1384
              Part.Transparency = Part.Transparency + Increment
1385
              Part.CFrame = Part.CFrame * CFrame.new(IncX, IncY, IncZ)
1386
              Part.CFrame = Part.CFrame * CFrame.new(SizeX, SizeY, SizeZ)
1387
            end
1388
            if Type == "DiappearBloom" then
1389
              Part.Transparency = Part.Transparency + Increment
1390
              Part.CFrame = Part.CFrame * CFrame.new(IncX, IncY, IncZ)
1391
            end
1392
          else
1393
            Part.Transparency = 1
1394
            Part:Destroy()
1395
            table.remove(partEffects, i)
1396
          end
1397
        end
1398
      end
1399
    end
1400
  end
1401
end)