View difference between Paste ID: egrSSbRh and xBbcEnjy
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
87
	local h,t
88
	--Give the server mouse data every second frame, but only if the values changed
89
	--If player is not moving their mouse, client won't fire events
90
	local HB = game:GetService("RunService").Heartbeat
91
	while true do
92
		if h~=Mouse.Hit or t~=Mouse.Target then
93
			h,t=Mouse.Hit,Mouse.Target
94
			Event:FireServer({isMouse=true,Target=t,Hit=h})
95
		end
96
		--Wait 2 frames
97
		for i=1,2 do
98
			HB:Wait()
99
		end
100
	end]==],script)
101
102
	----Sandboxed game object that allows the usage of client-side methods and services
103
	--Real game object
104
	local RealGame = game
105
106
	--Metatable for fake service
107
	local FakeService_Metatable = {
108
		__index = function(self,k)
109
			local s = rawget(self,"_RealService")
110
			if s then
111
				return typeof(s[k])=="function"
112
				and function(_,...)return s[k](s,...)end or s[k]
113
			end
114
		end,
115
		__newindex = function(self,k,v)
116
			local s = rawget(self,"_RealService")
117
			if s then s[k]=v end
118
		end
119
	}
120
	local function FakeService(t,RealService)
121
		t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
122
		return setmetatable(t,FakeService_Metatable)
123
	end
124
125
	--Fake game object
126
	local FakeGame = {
127
		GetService = function(self,s)
128
			return rawget(self,s) or RealGame:GetService(s)
129
		end,
130
		Players = FakeService({
131
			LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
132
		},"Players"),
133
		UserInputService = FakeService(UIS,"UserInputService"),
134
		ContextActionService = FakeService(CAS,"ContextActionService"),
135
		RunService = FakeService({
136
			_btrs = {},
137
			RenderStepped = RealGame:GetService("RunService").Heartbeat,
138
			BindToRenderStep = function(self,name,_,fun)
139
				self._btrs[name] = self.Heartbeat:Connect(fun)
140
			end,
141
			UnbindFromRenderStep = function(self,name)
142
				self._btrs[name]:Disconnect()
143
			end,
144
		},"RunService")
145
	}
146
	rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
147
	FakeGame.service = FakeGame.GetService
148
	FakeService(FakeGame,game)
149
	--Changing owner to fake player object to support owner:GetMouse()
150
	game,owner = FakeGame,FakeGame.Players.LocalPlayer
151
end
152
153
wait(0.2)
154
--[[ Arkuni Script ]]--
155
--[[ Declarations ]]--
156
wait(.0000000000000000000001)
157
local Player = game:GetService("Players").LocalPlayer
158
local Character = Player.Character
159
local Head = Character.Head
160
local Torso = Character.Torso
161
local Right_Arm = Character["Right Arm"]
162
local Right_Leg = Character["Right Leg"]
163
local Left_Arm = Character["Left Arm"]
164
local Left_Leg = Character["Left Leg"]
165
local Humanoid = Character.Humanoid
166
local Animation = "Idle"
167
local Mouse = Player:GetMouse()
168
local LeftShoulder = Torso["Left Shoulder"] 
169
local Left_Hip = Torso["Left Hip"] 
170
local RightShoulder = Torso["Right Shoulder"] 
171
local Right_Hip = Torso["Right Hip"] 
172
local Root = Character.HumanoidRootPart
173
local RootJoint = Root.RootJoint
174
local Attacking = false
175
local CanAttack = true
176
local Anim = "Idle"
177
local Combo = 1 
178
local Blocking = false
179
local MaxArk = 100
180
local Ark = 100
181
local MaxBlock = 100
182
local Effects = {}
183
local Color = "Bright yellow"
184
local Invert = false
185
local Idle = 0
186
local Equipped = false
187
local Running = false
188
local Unseathed = false
189
190
Humanoid.MaxHealth = 5000
191
Humanoid.Health = 5000
192
193
Left_Shoulder = Instance.new("Weld", Torso)
194
Left_Shoulder.Part0 = Torso
195
Left_Shoulder.Part1 = Left_Arm
196
Left_Shoulder.Name = "Left Shoulder"
197
Left_Shoulder.C0 = CFrame.new(-1.5,0,0)
198
199
Right_Shoulder = Instance.new("Weld", Torso)
200
Right_Shoulder.Part0 = Torso
201
Right_Shoulder.Part1 = Right_Arm
202
Right_Shoulder.Name = "Right Shoulder"
203
Right_Shoulder.C0 = CFrame.new(1.5,0,0)
204
205
LeftShoulder.Parent = nil
206
RightShoulder.Parent = nil
207
Humanoid.WalkSpeed = 10
208
209
local RootCFrame = CFrame.fromEulerAnglesXYZ(-1.57,0,3.14)
210
Necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
211
Necko2 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
212
Right_Hip_C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
213
Left_Hip_C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
214
215
216
Movemment = 1
217
Walk = 0
218
219
Animator = Humanoid.Animator
220
Animate = Character.Animate
221
222
Animator.Parent = nil
223
Animate.Parent = nil
224
225
--[[for i,v in pairs(Head:children()) do
226
	
227
if v:IsA("Sound") then
228
	
229
v:Remove()	
230
	
231
end		
232
end
233
]]--
234
235
local Services = {
236
237
SoundService = game:GetService("SoundService");
238
Players = game:GetService("Players");
239
Debris = game:GetService("Debris");
240
Workspace = game:GetService("Workspace");
241
Lighting = game:GetService("Lighting");
242
HttpService = game:GetService("HttpService");
243
InsertService = game:GetService("InsertService");
244
	
245
}
246
247
local ArkuniGui = Instance.new("BillboardGui", Head)
248
ArkuniGui.ExtentsOffset = Vector3.new(0,5,0)
249
ArkuniGui.Adornee = Head
250
ArkuniGui.AlwaysOnTop = true
251
ArkuniGui.Enabled = true
252
ArkuniGui.Size = UDim2.new(0, 200,0, 50)
253
254
local ArkuniText = Instance.new("TextLabel", ArkuniGui)
255
ArkuniText.BackgroundTransparency = 1
256
ArkuniText.Font = "Code"
257
ArkuniText.Size = UDim2.new(0, 200,0, 50)
258
ArkuniText.TextStrokeColor3 = BrickColor.Gray().Color
259
ArkuniText.TextStrokeTransparency = 0
260
ArkuniText.TextColor3 = Color3.new(1,1,1)
261
ArkuniText.TextScaled = true
262
ArkuniText.Text = "Arkuni"
263
264
--------[[ Mesh Ids ]]--------
265
266
-- Eh... This is just my Stock of Meshes
267
268
SpikeMeshId = 1033714
269
SpikeBallId = 9982590
270
StarMeshId = 45428961
271
CrystalMeshId = 9756362
272
273
--[[ Essential Functions ]]--
274
function NoOutlines(Part)
275
		Part.TopSurface,Part.BottomSurface,Part.LeftSurface,Part.RightSurface,Part.FrontSurface,Part.BackSurface = 10,10,10,10,10,10
276
end
277
	
278
279
local CreatePart = function(Parent, Name, Color, Size, Material, Transparency, Shape)
280
281
local Part = Instance.new("Part", Parent)
282
Part.Name = Name
283
Part.BrickColor = BrickColor.new(Color)
284
Part.Size = Size
285
Part.Material = Material
286
Part.Transparency = Transparency
287
Part.Shape = Shape
288
Part.CanCollide = false
289
NoOutlines(Part)
290
291
return Part
292
293
end
294
295
local CreateMesh = function(Parent, Scale, Shape)
296
297
298
local Mesh = Instance.new("BlockMesh", Parent)
299
Mesh.Scale = Scale
300
301
return Mesh
302
303
end
304
305
local CreateWedge = function(Parent, Name, Color, Size, Material, Transparency)
306
307
local WedgePart = Instance.new("WedgePart", Parent)
308
WedgePart.Name = Name
309
WedgePart.BrickColor = BrickColor.new(Color)
310
WedgePart.Size = Size
311
WedgePart.Material = Material
312
WedgePart.Transparency = Transparency
313
WedgePart.CanCollide = false
314
NoOutlines(WedgePart)
315
316
return WedgePart
317
318
end
319
320
local CreateWeld = function(Parent, Cframe, P1 , P0)
321
	
322
local Weld = Instance.new("Weld", Parent)
323
Weld.Part0 = P0
324
Weld.Part1 = P1
325
Weld.Name = P0.Name .. "To" .. P1.Name
326
Weld.C0 = Cframe
327
328
return Weld	
329
	
330
end
331
332
local CreateVelocity = function(Parent,Velocity,Force)
333
	
334
local BodyVelocity = Instance.new("BodyVelocity", Parent)
335
BodyVelocity.Velocity = Velocity
336
BodyVelocity.MaxForce = Force	
337
338
	
339
	
340
return BodyVelocity	
341
	
342
end
343
344
345
local CreateCrystal = function(Parent, Name, Color, Size, Material, Transparency, Scale)
346
347
348
local Part = Instance.new("Part", Parent)
349
Part.Name = Name
350
Part.BrickColor = BrickColor.new(Color)
351
Part.Size = Size
352
Part.Material = Material
353
Part.Transparency = Transparency
354
Part.CanCollide = false
355
NoOutlines(Part)
356
357
local Mesh = Instance.new("SpecialMesh", Part)
358
Mesh.MeshId = "http://www.roblox.com/asset?id=" .. CrystalMeshId
359
Mesh.Scale = Scale
360
361
return Mesh and Part
362
363
end
364
365
local MakeSFX = function(Parent, Id, Volume, Pitch)
366
	
367
local SFX = Instance.new("Sound", Parent)
368
SFX.SoundId = "http://www.roblox.com/asset?id=" .. Id
369
SFX.Name = "SFX"
370
SFX:Play()
371
SFX.Volume = Volume
372
SFX.Pitch = Pitch
373
SFX.PlayOnRemove = true
374
SFX:Remove()
375
	
376
end
377
378
CircleEffect = function(Position, Parent, SX, SY, SZ, Time, Brickcolor, Material, Transparency)
379
	
380
local Part = Instance.new("Part", Parent)
381
Part.Transparency = Transparency
382
Part.Name = "CircleEffect"
383
Part.Size = Vector3.new()
384
Part.Anchored = true
385
Part.CanCollide = false
386
Part.Position = Position
387
Part.BrickColor = BrickColor.new(Brickcolor)
388
Part.Material = Material
389
NoOutlines(Part)
390
391
local Mesh = Instance.new("SpecialMesh", Part)
392
Mesh.MeshType = "Sphere"
393
Mesh.Scale = Vector3.new(0,0,0)
394
395
Services.Debris:AddItem(Part, Time)
396
397
398
table.insert(Effects, {Part, "Circle", Time, SX, SY, SZ})
399
400
401
end
402
403
BlockEffect = function(Position, Parent, DSX, DSY, DSZ, SX, SY, SZ, Time, Brickcolor, Material, Transparency)
404
	
405
local Part = Instance.new("Part", Parent)
406
Part.Transparency = Transparency
407
Part.Name = "BlockEffect"
408
Part.Size = Vector3.new()
409
Part.Anchored = true
410
Part.Position = Position
411
Part.CanCollide = false
412
Part.BrickColor = BrickColor.new(Brickcolor)
413
Part.Material = Material
414
NoOutlines(Part)
415
416
local Mesh = Instance.new("BlockMesh", Part)
417
Mesh.Scale = Vector3.new(DSX, DSY, DSZ)
418
419
Services.Debris:AddItem(Part, Time)
420
421
table.insert(Effects, {Part, "Block", Time, SX, SY, SZ})
422
423
424
end
425
--[[ Uniform ]]--
426
Uniform = Instance.new("Model", Character)
427
Uniform.Name = "Uniform"
428
429
local Cloak = Instance.new("Part", Uniform)
430
Cloak.Name = "Cloak"
431
Cloak.CanCollide = false
432
Cloak.BrickColor = BrickColor.new("Institutional white")
433
434
local CloakMesh = Instance.new("SpecialMesh", Cloak)
435
CloakMesh.MeshId = "http://www.roblox.com/asset?id=16952952"
436
437
local CloakWeld = CreateWeld(Cloak, CFrame.new(0,-0.25,0) * CFrame.Angles(0,0,0), Head , Cloak, "ArkusToCharacter")
438
439
Arm1Color = Right_Arm.BrickColor.Color
440
Arm2Color = Left_Arm.BrickColor.Color
441
442
local TorsoCloak = CreatePart(Uniform, "TorsoCloak", "White", Vector3.new(2, 2, 1), "SmoothPlastic", 0, "Block")
443
444
local LeftArmCloak = CreatePart(Uniform, "LeftArmCloak", "White", Vector3.new(1, 1.7, 1), "SmoothPlastic", 0, "Block")
445
local RightArmCloak = CreatePart(Uniform, "RightArmCloak", "White", Vector3.new(1, 1.7, 1), "SmoothPlastic", 0, "Block")
446
local LeftArmCloak2 = CreatePart(Uniform, "LeftArmCloak2", "White", Vector3.new(0.6, 0.3, 1), "SmoothPlastic", 0, "Block")
447
local RightArmCloak2 = CreatePart(Uniform, "RightArmCloak2", "White", Vector3.new(0.6, 0.3, 1), "SmoothPlastic", 0, "Block")
448
local LeftArmCloak3 = CreateWedge(Uniform, "LeftArmCloak3", "White", Vector3.new(1.001, 0.3, 0.4), "SmoothPlastic", 0)
449
local RightArmCloak3 = CreateWedge(Uniform, "RightArmCloak3", "White", Vector3.new(1.001, 0.3, 0.4), "SmoothPlastic", 0)
450
local RightArmPart = CreatePart(Uniform, "RightArmPart",Arm1Color, Vector3.new(0.4, 0.3, 1), "SmoothPlastic", 0, "Block")
451
local LeftArmPart = CreatePart(Uniform, "LeftArmPart", Arm2Color, Vector3.new(0.4, 0.3, 1), "SmoothPlastic", 0, "Block")
452
453
454
local LeftLegCloak = CreatePart(Uniform, "LeftLegCloak", "White", Vector3.new(1, 1.8, 1), "SmoothPlastic", 0, "Block")
455
local RightLegCloak = CreatePart(Uniform, "RightLegCloak", "White", Vector3.new(1, 1.8, 1), "SmoothPlastic", 0, "Block")
456
local LeftLegCloak2 = CreatePart(Uniform, "LeftLegCloak2", "Dark stone grey", Vector3.new(1, 0.3, 1), "SmoothPlastic", 0, "Block")
457
local RightLegCloak2 = CreatePart(Uniform, "RightLegCloak2", "Dark stone grey", Vector3.new(1, 0.3, 1), "SmoothPlastic", 0, "Block")
458
459
local LeftLegCloak3 = CreatePart(Uniform, "LeftLegCloak3", "Fossil", Vector3.new(0.8, 0.43, 0.2), "SmoothPlastic", 0, "Block")
460
local RightLegCloak3 = CreatePart(Uniform, "RightLegCloak3", "Fossil", Vector3.new(0.8, 0.43, 0.2), "SmoothPlastic", 0, "Block")
461
462
local LeftLegCloak3Mesh = CreateMesh(LeftLegCloak3, Vector3.new(1, 1, 0.1), "Block")
463
local RightLegCloak3Mesh = CreateMesh(RightLegCloak3, Vector3.new(1, 1, 0.1), "Block")
464
465
local BeltPart1 = CreatePart(Uniform, "BeltPart1", "Institutional white", Vector3.new(2.1, 0.3, 1.1), "Granite", 0, "Block")
466
local BeltPart2 = CreatePart(Uniform, "BeltPart2", "Dark stone grey", Vector3.new(2.11, 0.3, 1.11), "SmoothPlastic", 0, "Block")
467
local BeltPart2Mesh = CreateMesh(BeltPart2, Vector3.new(1, 0.5, 1), "Block")
468
local BeltPart3 = CreatePart(Uniform, "BeltPart3", "Dark stone grey", Vector3.new(2.11, 0.3, 1.11), "SmoothPlastic", 0, "Block")
469
local BeltPart3Mesh = CreateMesh(BeltPart3, Vector3.new(1, 0.5, 1), "Block")
470
471
local UltimateCrystalPocket = CreatePart(Uniform, "UltimateCrystalPocket", "Institutional white", Vector3.new(0.6, 0.2, 0.5), "SmoothPlastic", 0, "Block")
472
UltimateCrystalPocketMesh = Instance.new("CylinderMesh", UltimateCrystalPocket)
473
UltimateCrystalPocketMesh.Scale = Vector3.new(1,0.01,1)
474
475
local EarthCrystal = CreateCrystal(Uniform, "Earth Crystal", "Burnt Sienna", Vector3.new(), "SmoothPlastic", 0.5,Vector3.new(0.1, 0.2, 0.1))
476
local FireCrystal = CreateCrystal(Uniform, "Fire Crystal", "Bright red", Vector3.new(), "SmoothPlastic", 0.5,Vector3.new(0.1, 0.2, 0.1))
477
local WaterCrystal = CreateCrystal(Uniform, "Fire Crystal", "Bright blue", Vector3.new(), "SmoothPlastic", 0.5,Vector3.new(0.1, 0.2, 0.1))
478
479
local LightingCrystal = CreateCrystal(Uniform, "Lighting Crystal", "Bright yellow", Vector3.new(), "SmoothPlastic", 0.5,Vector3.new(0.1, 0.2, 0.1))
480
local PlantCrystal = CreateCrystal(Uniform, "Plant Crystal", "Bright green", Vector3.new(), "SmoothPlastic", 0.5,Vector3.new(0.1, 0.2, 0.1))
481
local DarknessCrystal = CreateCrystal(Uniform, "Darkness Crystal", "Black", Vector3.new(), "SmoothPlastic", 0.5,Vector3.new(0.1, 0.2, 0.1))
482
483
local UltimateCrystal = CreateCrystal(Uniform, "Ultimate Crystal", "Medium stone grey", Vector3.new(), "SmoothPlastic", 0.5,Vector3.new(0.1, 0.2, 0.1))
484
485
TorsoCloakWeld = CreateWeld(TorsoCloak, CFrame.new(0,0,0), Torso, TorsoCloak)
486
LeftArmPartWeld = CreateWeld(LeftArmPart, CFrame.new(0.3,1,0), LeftArmCloak, LeftArmPart)
487
RightArmPartWeld = CreateWeld(RightArmPart, CFrame.new(-0.3,1,0), RightArmCloak, RightArmPart)
488
LeftArmCloakWeld = CreateWeld(LeftArmCloak, CFrame.new(0,-0,0), Right_Arm, LeftArmCloak)
489
RightArmCloakWeld = CreateWeld(RightArmCloak, CFrame.new(0,-0,0), Left_Arm, RightArmCloak)
490
LeftArmCloak2Weld = CreateWeld(LeftArmCloak2, CFrame.new(-0.2,1,0), LeftArmCloak, LeftArmCloak2)
491
RightArmCloak2Weld = CreateWeld(RightArmCloak2, CFrame.new(0.2,1,0), RightArmCloak, RightArmCloak2)
492
LeftArmCloak3Weld = CreateWeld(LeftArmCloak3,CFrame.new(0,-0.25,0.8) * CFrame.Angles(1.57,1.57,0), Left_Arm, LeftArmCloak3)
493
RightArmCloak3Weld = CreateWeld(RightArmCloak3,CFrame.new(0,-0.25,0.8) * CFrame.Angles(1.57,-1.57,0), Right_Arm, RightArmCloak3)
494
LeftLegCloakWeld = CreateWeld(LeftLegCloak, CFrame.new(0,-0.1,0), Left_Leg, LeftLegCloak)
495
RightLegCloakWeld = CreateWeld(RightLegCloak, CFrame.new(0,-0.1,0), Right_Leg, RightLegCloak)
496
LeftLegCloak2Weld = CreateWeld(LeftLegCloak2, CFrame.new(0,1.05,0), LeftLegCloak, LeftLegCloak2)
497
RightLegCloak2Weld = CreateWeld(RightLegCloak2, CFrame.new(0,1.05,0), RightLegCloak, RightLegCloak2)
498
LeftLegCloak3Weld = CreateWeld(LeftLegCloak3, CFrame.new(0,-0.1,0.5), LeftLegCloak2, LeftLegCloak3)
499
RightLegCloak3Weld = CreateWeld(RightLegCloak3, CFrame.new(0,-0.1,0.5), RightLegCloak2, RightLegCloak3)
500
BeltPart1Weld = CreateWeld(BeltPart1, CFrame.new(0,1,0), Torso, BeltPart1)
501
BeltPart2Weld = CreateWeld(BeltPart2, CFrame.new(0,0.8,0), Torso, BeltPart2)
502
BeltPart3Weld = CreateWeld(BeltPart3, CFrame.new(0,1.2,0), Torso, BeltPart3)
503
UltimateCrystalPocketWeld = CreateWeld(UltimateCrystalPocket, CFrame.new(-0.5,-0.5,-0.5) * CFrame.Angles(1.57,0,0), Torso, UltimateCrystalPocket)
504
UltimateCrystalWeld = CreateWeld(UltimateCrystal, CFrame.new(0,0,0) * CFrame.Angles(1.57,0,0), UltimateCrystalPocket, UltimateCrystal)
505
EarthCrystalWeld = CreateWeld(EarthCrystal, CFrame.new(0,0.35,0) * CFrame.Angles(1.57,0,0), UltimateCrystalPocket, EarthCrystal)
506
DarknessCrystalWeld = CreateWeld(DarknessCrystal, CFrame.new(0,-0.35,0) * CFrame.Angles(1.57,0,0), UltimateCrystalPocket, DarknessCrystal)
507
508
FireCrystalWeld = CreateWeld(EarthCrystal, CFrame.new(0.3,0.25,0) * CFrame.Angles(1.57,-0.2,0), UltimateCrystalPocket, FireCrystal)
509
LightingCrystalWeld = CreateWeld(DarknessCrystal, CFrame.new(0.3,0.25,0) * CFrame.Angles(-1.57,0.2,0), UltimateCrystalPocket, LightingCrystal)
510
511
WaterCrystalWeld = CreateWeld(WaterCrystal, CFrame.new(-0.3,-0.25,0) * CFrame.Angles(-1.57,0.2,0), UltimateCrystalPocket, WaterCrystal)
512
PlantCrystalWeld = CreateWeld(PlantCrystal, CFrame.new(-0.3,-0.25,0) * CFrame.Angles(1.57,-0.2,0), UltimateCrystalPocket, PlantCrystal)
513
514
Torso.Transparency = 1 
515
Left_Arm.Transparency = 1
516
Right_Arm.Transparency = 1
517
Left_Leg.Transparency = 1
518
Right_Leg.Transparency = 1
519
520
521
522
--[[ Arkus ]]--
523
524
local Arkus = Instance.new("Part", Character)
525
Arkus.Name = "Arkus"
526
Arkus.Size = Vector3.new()
527
528
local Mesh = Instance.new("SpecialMesh", Arkus)
529
Mesh.Scale = Vector3.new(1.8, 1.8, 2)
530
Mesh.MeshId = "http://www.roblox.com/asset/?id=11442510"
531
Mesh.TextureId = "http://www.roblox.com/asset/?id=12067965"
532
533
local ArkusWeld = CreateWeld(Arkus, CFrame.new(0,-0.5,0) * CFrame.Angles(-1.57,0,0.6), Torso , Arkus)
534
535
536
--[[ Damage function ]]--
537
538
539
function DamageFunction(Hit, Part, Type, HitSFX, Knockback, Min, Max)
540
	
541
local HitHumanoid = Hit.Parent.Humanoid
542
543
544
local Damage = math.random(Min, Max)
545
546
547
coroutine.resume(coroutine.create(function()
548
HitHumanoid:TakeDamage(Damage)
549
end))
550
	
551
if Type == "Normal" then
552
	
553
local Push = CreateVelocity(Hit.Parent.Torso, Torso.CFrame.lookVector * Knockback, Vector3.new(math.huge,math.huge,math.huge))
554
Services.Debris:AddItem(Push, 0)	
555
DamageLabel(Hit.Parent, Damage, Hit)
556
557
elseif Type == "Ranged" then
558
local Push = CreateVelocity(Hit.Parent.Torso, Part.CFrame.lookVector * Knockback, Vector3.new(math.huge,math.huge,math.huge))
559
Services.Debris:AddItem(Push, 0)	
560
DamageLabel(Hit.Parent, Damage, Hit)
561
562
elseif Type == "Knockdown" then
563
	
564
		
565
local Push = CreateVelocity(Hit.Parent.Torso, Part.CFrame.lookVector * Knockback, Vector3.new(math.huge,math.huge,math.huge))
566
DamageLabel(Hit.Parent, Damage, Hit)
567
Services.Debris:AddItem(Push, 0.3)
568
569
coroutine.resume(coroutine.create(function()
570
	
571
HitHumanoid.PlatformStand = true
572
wait(1)
573
HitHumanoid.PlatformStand = false	
574
	
575
	
576
end))	
577
end
578
579
if HitSFX == "Penetration" then
580
	
581
MakeSFX(Hit, 199149269, 1 , 1)
582
583
elseif HitSFX == "Punch" then
584
	
585
MakeSFX(Hit, 278062209, 1 , 1)
586
	
587
	
588
	
589
	
590
end
591
end
592
593
function DamageLabel(HitCharacter, DamageDealt, Hit)
594
	
595
local DamageShowingPart = CreatePart(Services.Workspace, "ShowDamage", "Bright yellow", Vector3.new(0.8,0.8,0.8), "Neon", 1, "Block")
596
DamageShowingPart.Position = HitCharacter.Head.Position
597
598
local DamageGui = Instance.new("BillboardGui", DamageShowingPart)
599
DamageGui.Name = "Damage"
600
DamageGui.AlwaysOnTop = true
601
DamageGui.Size = UDim2.new(5, 0, 5, 0)
602
603
local DamageNumber = Instance.new("TextLabel", DamageGui)
604
DamageNumber.Size = UDim2.new(1,0,1,0)
605
if Hit.Parent:FindFirstChild("Head") then
606
DamageNumber.TextStrokeColor3 = Hit.Parent.Head.BrickColor.Color
607
DamageNumber.TextColor3 = Hit.BrickColor.Color
608
end
609
DamageNumber.TextStrokeTransparency = 0
610
DamageNumber.BackgroundTransparency = 1
611
DamageNumber.Font = "SourceSansBold"
612
DamageNumber.TextScaled = true
613
DamageNumber.Text = DamageDealt
614
	
615
local BodyVelocity = Instance.new("BodyVelocity", DamageShowingPart)
616
BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
617
BodyVelocity.Velocity = Vector3.new(0,2,0)	
618
	
619
Services.Debris:AddItem(DamageShowingPart, 3)
620
	
621
	
622
end 
623
624
function ValidateDamage(Part, Distance ,Min , Max, Type, HitSFX, Knockback)
625
for _,WorkspaceChildren in pairs(workspace:children()) do
626
	
627
local HitHumanoid = WorkspaceChildren:findFirstChild("Humanoid")
628
629
if HitHumanoid ~= nil then
630
local Hit = WorkspaceChildren:findFirstChild("Torso")
631
632
if Hit ~= nil then
633
	
634
local Target = Hit.Position - Part.Position
635
636
local Magnitude = Target.magnitude
637
638
if Magnitude <= Distance and WorkspaceChildren.Name ~= Player.Name then
639
	
640
local HitBlock = Hit.Parent:FindFirstChild("Block")	
641
	
642
if HitBlock ~= nil and HitBlock:FindFirstChild("BlockDurability") and HitBlock.Value == true then
643
644
local HitBlock2 = Hit.Parent.Block.BlockDurability	
645
	
646
if HitBlock2.Value > 15 then
647
	
648
local HitN = math.random(1,5)
649
	
650
HitBlock2.Value = HitBlock2.Value - 15	
651
	
652
	
653
if HitN == 1 then
654
MakeSFX(Hit ,199148971, 0.5, 1)	
655
end
656
657
if HitN == 2 then
658
MakeSFX(Hit ,199149025, 0.5, 1)	
659
end
660
661
if HitN == 3 then
662
MakeSFX(Hit ,199149072, 0.5, 1)	
663
end
664
665
if HitN == 4 then
666
MakeSFX(Hit ,199149109, 0.5, 1)	
667
end
668
669
if HitN == 5 then
670
MakeSFX(Hit ,199149119, 0.5, 1)	
671
end
672
return
673
end	
674
end
675
676
DamageFunction(Hit, Part, Type, HitSFX, Knockback, Min, Max)
677
678
	
679
680
end
681
end
682
end
683
end
684
end
685
 
686
687
688
--[[ Attacks ]]--
689
690
691
692
function ArktizuAttack1()
693
694
Attacking = true
695
MakeSFX(Left_Arm, 320557563, 1, 1)
696
697
for i = 1,6 do
698
699
wait()
700
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,-1.6),0.2)
701
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0,0,1),0.2)
702
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(1,0.3,-0.5) * CFrame.Angles(0.8,0,-1), 0.3)
703
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-2,0.5,-0.5) * CFrame.Angles(1.57,0,-1), 0.5)
704
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
705
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
706
707
end
708
709
ValidateDamage(Left_Arm, 3 ,10 , 14, "Normal", "Punch", 5)
710
711
Attacking = false
712
	
713
	
714
end
715
716
717
function ArktizuAttack2()
718
719
Attacking = true
720
MakeSFX(Right_Arm, 320557563, 1, 1)
721
722
for i = 1,6 do
723
724
wait()
725
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,1.6),0.2)
726
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0,0,-1),0.2)
727
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(2,0.5,-0.5) * CFrame.Angles(1.57,0,1), 0.3)
728
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1,0.3,-0.5) * CFrame.Angles(0.8,0,1), 0.3)
729
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
730
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
731
732
end
733
734
ValidateDamage(Right_Arm, 3 ,10 , 14, "Normal", "Punch", 5)
735
736
Attacking = false
737
	
738
	
739
end
740
741
function ArktizuAttack3()
742
743
Attacking = true
744
MakeSFX(Right_Leg, 320557563, 1, 1)
745
746
for i = 1,6 do
747
748
wait()
749
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,1.6),0.5)
750
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0,0,-1),0.2)
751
Right_Shoulder.C0 = clerp(Right_Shoulder.C0, CFrame.new(0.8, 0.5, -0.8) * CFrame.Angles(1.8,0,-1), 0.3)
752
Left_Shoulder.C0 = clerp(Left_Shoulder.C0,  CFrame.new(-0.8, 0.5, -0.8) * CFrame.Angles(1.8,0,1), 0.4)
753
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(0.5,-1,0.5) * CFrame.Angles(0,0,1.6),0.3)
754
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-0.5,-1,-0.5) * CFrame.Angles(0,-3.2,0),0.3) 
755
756
end
757
758
ValidateDamage(Right_Leg, 3 ,10 , 14, "Normal", "Punch", 5)
759
760
Attacking = false
761
	
762
	
763
end
764
765
function ArktizuAttack4()
766
767
Attacking = true
768
MakeSFX(Left_Leg, 320557563, 1, 1)
769
770
for i = 1,6 do
771
772
wait()
773
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,-1.6),0.5)
774
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0,0,1),0.2)
775
Right_Shoulder.C0 = clerp(Right_Shoulder.C0, CFrame.new(0.8, 0.5, -0.8) * CFrame.Angles(1.8,0,-1), 0.3)
776
Left_Shoulder.C0 = clerp(Left_Shoulder.C0,  CFrame.new(-0.8, 0.5, -0.8) * CFrame.Angles(1.8,0,1), 0.4)
777
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(0.5,-1,-0.5) * CFrame.Angles(0,3.2,0),0.3)
778
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-0.5,-1,-0.5) * CFrame.Angles(0,0,-1.6),0.3) 
779
780
end
781
782
ValidateDamage(Left_Leg, 3 ,10 , 14, "Normal", "Punch", 5)
783
784
Attacking = false
785
	
786
	
787
end
788
789
function Unseath()
790
791
Attacking = true
792
Unseathed = true
793
794
local Unseath = Instance.new("Sound", Arkus) 
795
Unseath.SoundId = "rbxasset://sounds\\unsheath.wav"
796
Unseath.PlayOnRemove = true
797
Unseath:Play()
798
wait()
799
Unseath:Remove()
800
801
for i = 1,6 do
802
wait()
803
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0.5),0.2)
804
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.2,0,-0.3),0.3)
805
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(1.3,1,0) * CFrame.Angles(3.8,0,0.8), 0.3)
806
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5,0.3,0) * CFrame.Angles(0,0,-0.2), 0.3)
807
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
808
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
809
810
end
811
812
ArkusWeld.Part1 = Right_Arm
813
ArkusWeld.C0 = CFrame.new(1.1,0.3,-2.2)* CFrame.Angles(3.2,0.1,-1.6)
814
815
for i = 1,6 do
816
wait()
817
	
818
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0.5),0.2)
819
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.2,0,-0.3),0.3)
820
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(1.5,0.1,0) * CFrame.Angles(0,0,0.2), 0.3)
821
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5,0.1,0) * CFrame.Angles(0,0,-0.2), 0.3)
822
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
823
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
824
825
end
826
827
Attacking = false
828
	
829
	
830
end
831
832
function Seath()
833
834
Attacking = true
835
Unseathed = false
836
local Unseath = Instance.new("Sound", Arkus) 
837
Unseath.SoundId = "rbxasset://sounds\\unsheath.wav"
838
Unseath.PlayOnRemove = true
839
Unseath:Play()
840
wait()
841
Unseath:Remove()
842
843
for i = 1,6 do
844
wait()
845
	
846
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0.5),0.2)
847
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.2,0,-0.3),0.3)
848
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(1.3,1,0) * CFrame.Angles(3.8,0,-0.2), 0.3)
849
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5,0.3,0) * CFrame.Angles(0,0,-0.2), 0.3)
850
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
851
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
852
853
end
854
855
ArkusWeld.Part1 = Torso
856
ArkusWeld.C0 = CFrame.new(0,-0.5,0) * CFrame.Angles(-1.57,0,0.6)
857
858
for i = 1,6 do
859
wait()
860
	
861
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0.5),0.2)
862
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.2,0,-0.3),0.3)
863
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(1.3,1,0) * CFrame.Angles(3.8,0,-0.2), 0.3)
864
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5,0.3,0) * CFrame.Angles(0,0,-0.2), 0.3)
865
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
866
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
867
868
end
869
870
Attacking = false
871
	
872
	
873
end
874
875
876
--[[ Tool & Tool Functions ]]--
877
878
local Tool = Instance.new("HopperBin", Player.Backpack)
879
Tool.Name = "Arkus"
880
881
Tool.Selected:connect(function(Mouse)
882
	
883
Mouse.Button1Down:connect(function()
884
if not Attacking and Equipped and not Unseathed then
885
886
if Combo == 1 then
887
	
888
ArktizuAttack1()	
889
Combo = 2
890
891
elseif Combo == 2 then
892
	
893
ArktizuAttack2()
894
Combo = 3
895
896
elseif Combo == 3 then
897
	
898
ArktizuAttack3()
899
Combo = 4
900
901
elseif Combo == 4 then
902
	
903
ArktizuAttack4()
904
Combo = 1
905
906
elseif not Attacking and Equipped and Unseathed then
907
908
909
end
910
911
912
end
913
end)	
914
	
915
Mouse.KeyDown:connect(function(Key)
916
	
917
if Key == "y" and not Attacking then
918
919
if Running == false then
920
Running = true
921
	
922
Humanoid.WalkSpeed = 50	
923
Humanoid.JumpPower = 150	
924
925
926
elseif Running == true then
927
Running = false
928
	
929
Humanoid.WalkSpeed = 10	
930
Humanoid.JumpPower = 50	
931
932
end
933
934
end	
935
	
936
if Key == "q" and Equipped and not Attacking then
937
938
if not Unseathed then
939
Unseath()
940
Combo = 1
941
942
elseif Unseathed then
943
944
Seath()
945
Combo = 1
946
947
end		
948
	
949
end	
950
	
951
	
952
if Key == "e" then	
953
	
954
if Equipped == false then
955
Equipped = true
956
957
elseif Equipped == true and not Unseathed then	
958
Equipped = false
959
960
elseif Unseathed and Equipped == true then
961
Seath()
962
Equipped = false
963
964
965
end
966
end
967
end)	
968
	
969
Mouse.KeyUp:connect(function(Key)
970
971
end)
972
end)
973
974
975
--[[ CLerp Declarations ]]--
976
977
function clerp(a,b,t) 
978
local qa = {QuaternionFromCFrame(a)}
979
local qb = {QuaternionFromCFrame(b)} 
980
local ax, ay, az = a.x, a.y, a.z 
981
local bx, by, bz = b.x, b.y, b.z
982
local _t = 1-t
983
return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t)) 
984
end 
985
 
986
function QuaternionFromCFrame(cf) 
987
local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components() 
988
local trace = m00 + m11 + m22 
989
if trace > 0 then 
990
local s = math.sqrt(1 + trace) 
991
local recip = 0.5/s 
992
return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5 
993
else 
994
local i = 0 
995
if m11 > m00 then
996
i = 1
997
end
998
if m22 > (i == 0 and m00 or m11) then 
999
i = 2 
1000
end 
1001
if i == 0 then 
1002
local s = math.sqrt(m00-m11-m22+1) 
1003
local recip = 0.5/s 
1004
return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip 
1005
elseif i == 1 then 
1006
local s = math.sqrt(m11-m22-m00+1) 
1007
local recip = 0.5/s 
1008
return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip 
1009
elseif i == 2 then 
1010
local s = math.sqrt(m22-m00-m11+1) 
1011
local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip 
1012
end 
1013
end 
1014
end
1015
 
1016
function QuaternionToCFrame(px, py, pz, x, y, z, w) 
1017
local xs, ys, zs = x + x, y + y, z + z 
1018
local wx, wy, wz = w*xs, w*ys, w*zs 
1019
local xx = x*xs 
1020
local xy = x*ys 
1021
local xz = x*zs 
1022
local yy = y*ys 
1023
local yz = y*zs 
1024
local zz = z*zs 
1025
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)) 
1026
end
1027
 
1028
function QuaternionSlerp(a, b, t) 
1029
local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4] 
1030
local startInterp, finishInterp; 
1031
if cosTheta >= 0.0001 then 
1032
if (1 - cosTheta) > 0.0001 then 
1033
local theta = math.acos(cosTheta) 
1034
local invSinTheta = 1/math.sin(theta) 
1035
startInterp = math.sin((1-t)*theta)*invSinTheta 
1036
finishInterp = math.sin(t*theta)*invSinTheta  
1037
else 
1038
startInterp = 1-t 
1039
finishInterp = t 
1040
end 
1041
else 
1042
if (1+cosTheta) > 0.0001 then 
1043
local theta = math.acos(-cosTheta) 
1044
local invSinTheta = 1/math.sin(theta) 
1045
startInterp = math.sin((t-1)*theta)*invSinTheta 
1046
finishInterp = math.sin(t*theta)*invSinTheta 
1047
else 
1048
startInterp = t-1 
1049
finishInterp = t 
1050
end 
1051
end 
1052
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 
1053
end
1054
1055
function RayCast(Pos, Dir, Max, Ignore)
1056
return game:service("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) 
1057
end 
1058
1059
--[[ CLerp Animations ]]--
1060
Change1 = 0
1061
Change2 = 0
1062
Change3 = 0
1063
Change4 = 0
1064
1065
coroutine.resume(coroutine.create(function()
1066
while true do	
1067
local Torvel = (Root.Velocity*Vector3.new(1,0,1)).magnitude 
1068
local Velderp = Root.Velocity.y
1069
HitFloor,PosFloor = RayCast(Root.Position,(CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector,4,Character)	
1070
1071
wait()
1072
if 30 <= Torvel and HitFloor ~= nil then
1073
	
1074
	Anim = "Running"
1075
WalkForward = true
1076
      Walk = Walk + 1
1077
              if 15 - 5 * Movemment <= Walk then
1078
                Walk = 0
1079
                if WalkForward == true then
1080
                  WalkForward = false
1081
                else
1082
                  if WalkForward == false then
1083
                    WalkForward = true
1084
                  end
1085
                end
1086
              end
1087
1088
if Attacking == false then
1089
1090
if Invert == false then
1091
1092
Change2 = Change2 + 2
1093
1094
elseif Invert == true then
1095
	
1096
Change2 = Change2 - 2
1097
1098
end
1099
1100
if Change2 > 0.1 then
1101
	
1102
Invert = true
1103
1104
elseif Change2 < -0.1 then
1105
1106
Invert  = false
1107
1108
1109
	
1110
end
1111
end
1112
end
1113
end
1114
end))
1115
1116
while true do
1117
1118
wait()
1119
1120
local Torvel = (Root.Velocity*Vector3.new(1,0,1)).magnitude 
1121
local Velderp = Root.Velocity.y
1122
HitFloor,PosFloor = RayCast(Root.Position,(CFrame.new(Root.Position,Root.Position - Vector3.new(0,1,0))).lookVector,4,Character)	
1123
1124
if Torvel < 1 and HitFloor ~= nil and Attacking == false then
1125
Anim = "Idle"
1126
Jump = false
1127
if Equipped == false then
1128
1129
1130
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0),0.2)
1131
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.2,0,-0.3),0.3)
1132
Right_Shoulder.C0 = clerp(Right_Shoulder.C0, CFrame.new(0.21,0.5, -1) * CFrame.Angles(1.6,0,-1.3), 0.3)
1133
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-0.21,0.5,-1) * CFrame.Angles(1.6,0,1.3), 0.3)
1134
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
1135
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
1136
1137
1138
elseif Equipped and Unseathed then
1139
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0.5),0.2)
1140
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.2,0,-0.3),0.3)
1141
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(1.5,0.2,0) * CFrame.Angles(0,0,0.2), 0.3)
1142
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5,0.2,0) * CFrame.Angles(0,0,-0.2), 0.3)
1143
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
1144
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
1145
1146
elseif Equipped == true then
1147
	
1148
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0.5),0.2)
1149
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.2,0,-0.3),0.3)
1150
Right_Shoulder.C0 = clerp(Right_Shoulder.C0,CFrame.new(1.3,1,0) * CFrame.Angles(3.8,0,-0.2), 0.3)
1151
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5,0.3,0) * CFrame.Angles(0,0,-0.2), 0.3)
1152
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0)*CFrame.Angles(0,1.6,0),0.2)
1153
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
1154
1155
1156
end
1157
end
1158
1159
1160
if 2 < Torvel and Torvel < 22 and HitFloor ~= nil and Attacking == false then
1161
Anim = "Walking"
1162
WalkForward = true
1163
      Walk = Walk + 1
1164
              if 15 - 5 * Movemment <= Walk then
1165
                Walk = 0
1166
                if WalkForward == true then
1167
                  WalkForward = false
1168
                else
1169
                  if WalkForward == false then
1170
                    WalkForward = true
1171
                  end
1172
                end
1173
              end
1174
1175
1176
if Invert == false then
1177
Change1 = Change1 + 0.1
1178
1179
elseif Invert == true then
1180
	
1181
Change1 = Change1 - 0.1
1182
1183
end
1184
1185
if Change1 > 0.5 then
1186
	
1187
Invert = true
1188
1189
elseif Change1 < -0.5 then
1190
1191
Invert  = false
1192
1193
1194
	
1195
end
1196
1197
Jump = false
1198
if Attacking == false then
1199
1200
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0.2,0,0),0.2)
1201
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.1,0,0),0.3)
1202
Right_Shoulder.C0 = clerp(Right_Shoulder.C0, CFrame.new(1.5, 0.2, -Change1) * CFrame.Angles(Change1,0,0), 0.3)
1203
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5, 0.2, Change1) * CFrame.Angles(-Change1,0,0), 0.3)
1204
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,-Change1 / 4)*CFrame.Angles(Change1 + 0.1,1.6,0),0.2)
1205
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,Change1 / 4)*CFrame.Angles(-Change1 + 0.1,-1.6,0),0.2)
1206
1207
end
1208
end
1209
1210
if Root.Velocity.y > 1 and HitFloor == nil and Attacking == false then 
1211
	
1212
Anim = "Jump"
1213
Jump = false
1214
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0),0.2)
1215
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(-0.5,0,0),0.3)
1216
Right_Shoulder.C0 = clerp(Right_Shoulder.C0, CFrame.new(1.5, 0.2, 0.2) * CFrame.Angles(-0.4,0,0.2), 0.3)
1217
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5, 0.2, 0.2) * CFrame.Angles(-0.4,0,-0.2), 0.3)
1218
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,-0.2)*CFrame.Angles(-0.2,1.6,0),0.2)
1219
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
1220
1221
1222
end
1223
1224
if Root.Velocity.y < -1 and HitFloor == nil and Attacking == false then 
1225
1226
Anim = "Falling"
1227
Jump = true
1228
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,0,0)* CFrame.Angles(0,0,0),0.2)
1229
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(0.5,0,0),0.3)
1230
Right_Shoulder.C0 = clerp(Right_Shoulder.C0, CFrame.new(1.5, 0.2, -0.2) * CFrame.Angles(0.4,0,0.2), 0.3)
1231
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5, 0.2, -0.2) * CFrame.Angles(0.4,0,-0.2), 0.3)
1232
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,-0.2)*CFrame.Angles(-0.2,1.6,0),0.2)
1233
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0)*CFrame.Angles(0,-1.6,0),0.2)
1234
1235
end
1236
1237
if 30 <= Torvel and HitFloor ~= nil then
1238
	Jump = false	
1239
	Anim = "Running"
1240
WalkForward = true
1241
      Walk = Walk + 1
1242
              if 15 - 5 * Movemment <= Walk then
1243
                Walk = 0
1244
                if WalkForward == true then
1245
                  WalkForward = false
1246
                else
1247
                  if WalkForward == false then
1248
                    WalkForward = true
1249
                  end
1250
                end
1251
              end
1252
1253
if Attacking == false then
1254
1255
1256
	
1257
RootJoint.C0 = clerp(RootJoint.C0,RootCFrame*CFrame.new(0,-0.2,0)* CFrame.Angles(1,0,0),0.2)
1258
Torso.Neck.C0 = clerp(Torso.Neck.C0,Necko * CFrame.Angles(-0.5,0,0),0.3)
1259
Right_Shoulder.C0 = clerp(Right_Shoulder.C0, CFrame.new(1.5, 0.3, 0.5) * CFrame.Angles(-1,0,0), 0.3)
1260
Left_Shoulder.C0 = clerp(Left_Shoulder.C0, CFrame.new(-1.5, 0.3, 0.5) * CFrame.Angles(-1,0,0), 0.3)
1261
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,-Change2 / 4)*CFrame.Angles(Change2 + 0.5,1.6,0),0.5)
1262
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,Change2 / 4)*CFrame.Angles(-Change2 + 0.5,-1.6,0),0.5)
1263
1264
end
1265
Right_Hip.C0=clerp(Right_Hip.C0,CFrame.new(1,-1,0) * CFrame.Angles(0,1.6,0),0.2)
1266
Left_Hip.C0=clerp(Left_Hip.C0,CFrame.new(-1,-1,0) * CFrame.Angles(0,-1.6,0),0.2) 
1267
	
1268
end
1269
1270
for i,v in pairs(Character:children()) do
1271
	
1272
if v:IsA("Shirt") then
1273
	
1274
v:Remove()
1275
1276
elseif v:IsA("Pants") then
1277
	
1278
v:Remove()
1279
1280
elseif v:IsA("Hat") then
1281
	
1282
v:Remove()
1283
1284
elseif v:IsA("ShirtGraphic") then
1285
	
1286
v:Remove()
1287
1288
1289
for a,x in pairs(v:children()) do
1290
	
1291
if x:IsA("Decal") then
1292
	
1293
x:Remove()
1294
1295
end
1296
end
1297
end		
1298
end
1299
1300
1301
if #Effects > 0 then
1302
for E = 1, #Effects do
1303
if Effects[E]~=nil then
1304
local Effect = Effects[E]
1305
1306
if Effect ~= nil then
1307
	
1308
local Part = Effect[1]
1309
local Mode = Effect[2]
1310
local Time = Effect[3]
1311
local SizeX = Effect[4]
1312
local SizeY = Effect[5]
1313
local SizeZ = Effect[6]
1314
1315
if Effect[1].Transparency <= 1 then
1316
if Effect[2] == "Block" then
1317
Effect[1].CFrame = Effect[1].CFrame * CFrame.Angles(math.random(-50,50),math.random(-50,50),math.random(-50,50))
1318
1319
Mesh = Effect[1]:FindFirstChild("Mesh")
1320
if Mesh ~= nil then
1321
Mesh.Scale = Mesh.Scale + Vector3.new(Effect[4],Effect[5],Effect[6])
1322
end
1323
1324
elseif Effect[2] == "Circle" then
1325
	
1326
if Effect[1]:FindFirstChild("Mesh") ~= nil then
1327
Mesh=Effect[1].Mesh
1328
Mesh.Scale = Mesh.Scale + Vector3.new(Effect[4],Effect[5],Effect[6])
1329
end
1330
1331
else
1332
	
1333
Part.Parent=nil
1334
1335
table.remove(Effects, E)
1336
1337
end
1338
end
1339
end
1340
end
1341
end
1342
end
1343
end