View difference between Paste ID: 4Myqs6eE and FM7CK6vV
SHOW: | | - or go back to the newest paste.
1
-- This script has been converted to FE by iPxter
2
3
4
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
5
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
6
do
7
	print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
8
	script.Parent = Player.Character
9
10
	--RemoteEvent for communicating
11
	local Event = Instance.new("RemoteEvent")
12
	Event.Name = "UserInput_Event"
13
14
	--Fake event to make stuff like Mouse.KeyDown work
15
	local function fakeEvent()
16
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
17
		t.connect = t.Connect
18
		return t
19
	end
20
21
	--Creating fake input objects with fake variables
22
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
23
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
24
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
25
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
26
	end}
27
	--Merged 2 functions into one by checking amount of arguments
28
	CAS.UnbindAction = CAS.BindAction
29
30
	--This function will trigger the events that have been :Connect()'ed
31
	local function te(self,ev,...)
32
		local t = m[ev]
33
		if t and t._fakeEvent and t.Function then
34
			t.Function(...)
35
		end
36
	end
37
	m.TrigEvent = te
38
	UIS.TrigEvent = te
39
40
	Event.OnServerEvent:Connect(function(plr,io)
41
	    if plr~=Player then return end
42
		if io.isMouse then
43
			m.Target = io.Target
44
			m.Hit = io.Hit
45
		else
46
			local b = io.UserInputState == Enum.UserInputState.Begin
47
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
48
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
49
			end
50
			for _,t in pairs(CAS.Actions) do
51
				for _,k in pairs(t.Keys) do
52
					if k==io.KeyCode then
53
						t.Function(t.Name,io.UserInputState,io)
54
					end
55
				end
56
			end
57
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
58
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
59
	    end
60
	end)
61
	Event.Parent = NLS([==[
62
	local Player = game:GetService("Players").LocalPlayer
63
	local Event = script:WaitForChild("UserInput_Event")
64
65
	local UIS = game:GetService("UserInputService")
66
	local input = function(io,a)
67
		if a then return end
68
		--Since InputObject is a client-side instance, we create and pass table instead
69
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
70
	end
71
	UIS.InputBegan:Connect(input)
72
	UIS.InputEnded:Connect(input)
73
74
	local Mouse = Player:GetMouse()
75
	local h,t
76
	--Give the server mouse data 30 times every second, but only if the values changed
77
	--If player is not moving their mouse, client won't fire events
78
	while wait(1/30) do
79
		if h~=Mouse.Hit or t~=Mouse.Target then
80
			h,t=Mouse.Hit,Mouse.Target
81
			Event:FireServer({isMouse=true,Target=t,Hit=h})
82
		end
83
	end]==],Player.Character)
84
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
85
end
86
87
-- the head basher sword
88
function rand(a)return (math.random()-.5)*2*a end
89
function q(f,arg)return coroutine.resume(coroutine.create(f),unpack(arg or {}))end
90
function fade(p,s)q(function(part,start)for i=start,1,.05 do part.Transparency = part.Transparency+0.05 wait(1/30)end end,{p,s})end
91
function appear(p,s)q(function(part,start)for i=start,0,-.05 do part.Transparency = part.Transparency-0.05 wait(1/30)end end,{p,s})end
92
function Part(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
93
	local p = Instance.new("Part",Parent)p.Name = Name
94
	p.FormFactor = "Custom"p.Size = Size
95
	p.Anchored = Anch p.CFrame = CFrame
96
	p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
97
	p.TopSurface = 0 p.CanCollide = Can
98
	p.BottomSurface = 0 p.Material = Mat
99
	p.Reflectance = Ref or 0;p:BreakJoints()
100
	p.Locked = true;return p
101
end
102
function WedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
103
	local p = Instance.new("WedgePart",Parent)p.Name = Name
104
	p.FormFactor = "Custom"p.Size = Size
105
	p.Anchored = Anch p.CFrame = CFrame
106
	p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
107
	p.TopSurface = 0 p.CanCollide = Can
108
	p.BottomSurface = 0 p.Material = Mat
109
	p.Reflectance = Ref or 0;p:BreakJoints()
110
	p.Locked = true;return p
111
end
112
function CornerWedgePart(Name,Parent,Size,CFrame,Color,Trans,Anch,Can,Mat,Ref)
113
	local p = Instance.new("CornerWedgePart",Parent)p.Name = Name;p.Size = Size
114
	p.Anchored = Anch p.CFrame = CFrame
115
	p.BrickColor = BrickColor.new(Color)p.Transparency = Trans
116
	p.TopSurface = 0 p.CanCollide = Can
117
	p.BottomSurface = 0 p.Material = Mat
118
	p.Reflectance = Ref or 0;p:BreakJoints()
119
	p.Locked = true;return p
120
end
121
function Mesh(Parent,Type,Scale,ID,TID)
122
	local m = Instance.new("SpecialMesh",Parent)m.MeshType = Type
123
	m.Scale = Scale or Vector3.new(1,1,1)
124
	if ID then m.MeshId = ID end if TID then m.TextureId = TID end
125
	return m
126
end
127
function Weld(p1,p2,c0,c1)
128
	local w = Instance.new("Weld",p1)w.Part0 = p1;w.Part1 = p2
129
	w.C0,w.C1 = c0 or CFrame.new(),c1 or CFrame.new()
130
	return w
131
end
132
function cslerp(c1,c2,t)
133
	local function s(a,b,c)return (1-c)*a+(c*b)end 
134
	local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
135
	local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
136
	for i,v in pairs(com1)do com1[i] = s(v,com2[i],t)end
137
	return CFrame.new(com1[1],com1[2],com1[3])*CFrame.Angles(select(4,unpack(com1)))
138
end
139
---------------------------------------------
140
player = owner
141
local char
142
repeat wait() char = player.Character until char
143
root = char:WaitForChild("HumanoidRootPart")
144
torso = char:WaitForChild("Torso")
145
humanoid = char:WaitForChild("Humanoid")
146
step = game:service("RunService").Stepped
147
asset = "http://www.roblox.com/asset/?id="
148
meshes = {["blast"] = 20329976,["ring"] = 3270017,["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["cloud"] = 1095708,["diamond"] = 9756362}
149
sounds = {}
150
Mode = ""
151
c0 = {
152
	ls = CFrame.new(-1,0.5,0),
153
	rs = CFrame.new(1,0.5,0),
154
	lh = CFrame.new(-1,-1,0),
155
	rh = CFrame.new(1,-1,0),
156
	nk = CFrame.new(0,1,0),
157
	tw = CFrame.new(0,0,0),
158
}
159
c1 = {
160
	ls = CFrame.new(0.5,0.5,0),
161
	rs = CFrame.new(-0.5,0.5,0),
162
	lh = CFrame.new(-.5,1,0),
163
	rh = CFrame.new(.5,1,0),
164
	nk = CFrame.new(0,-.5,0),
165
	tw = CFrame.new(0,0,0),
166
}
167
rh = Weld(torso,char:WaitForChild("Right Leg"),c0.rh,c1.rh)
168
rs = Weld(torso,char:WaitForChild("Right Arm"),c0.rs,c1.rs)
169
lh = Weld(torso,char:WaitForChild("Left Leg"),c0.lh,c1.lh)
170
ls = Weld(torso,char:WaitForChild("Left Arm"),c0.ls,c1.ls)
171
ne = Weld(torso,char:WaitForChild("Head"),c0.nk,c1.nk)
172
rw = Weld(root,torso,c0.tw,c1.tw)
173
cWalkS = 20
174
lastpulse = tick()
175
pulsetime = 2.25
176
Attacking = false
177
colour = {"Black","Bright yellow"}
178
Idles = {"FAB"}
179
lastIdle = tick()
180
curIdle = ""
181
isIdlePosing = false
182
startedIdle = 0
183
bIdleTime = 10
184
---------------------------------------------
185
function Smoke(origin,color)
186
	local p = Part("Effect",workspace,Vector3.new(2,2,2),origin*CFrame.new(rand(5),-1,rand(5)),color or "Black",.1,false,false,"SmoothPlastic")
187
	local m = Mesh(p,"Sphere",Vector3.new(1.25,1.25,1.25))
188
local bp = Instance.new("BodyPosition",p)bp.D = 100 bp.P = 100 bp.position = p.Position+Vector3.new(0,7,0)
189
	q(function(pa,me)
190
		fade(pa,.1)
191
		for i=25,100 do
192
			me.Scale = me.Scale+Vector3.new(0.15,0.1,0.15)
193
			wait(1/30)
194
		end
195
		pa:Destroy()
196
	end,{p,m})
197
end
198
function brickMagic(origin,color,size)
199
	local p = Part("Effect",workspace,Vector3.new(size,size,size),origin*CFrame.Angles(rand(5),rand(5),rand(5)),color,.2,true,false,"SmoothPlastic")
200
	local m = Mesh(p,"Brick")
201
	q(function(pa,me)
202
		fade(pa,.2)
203
		for i=20,100 do
204
			me.Scale = me.Scale-Vector3.new(0.05,0.05,0.05)
205
			wait(1/30)
206
		end
207
		pa:Destroy()
208
	end,{p,m})
209
end
210
function spikeMagic(origin,size,color)
211
	local p = Part("Effect",workspace,Vector3.new(1,1,1),origin*CFrame.new(0,-size,0),color,1,true,false,"SmoothPlastic")
212
	local m = Mesh(p,"FileMesh",Vector3.new(size/2,size*2,size/2),asset..meshes["spike"])
213
	q(function(pa,me)
214
	appear(pa,1)
215
	for i=1,size,.5 do
216
		wait(1/30)
217
		pa.CFrame = pa.CFrame*CFrame.new(0,.5,0)
218
	end
219
	wait(math.random(2,3))fade(pa,0)
220
	Delay(3,function()pa:Destroy()end)
221
	end,{p,m})
222
end
223
function placePart(origin,size,color,material)
224
	local p = Part("Effect",workspace,Vector3.new(size,size,size),origin*CFrame.Angles(rand(5),rand(5),rand(5)),color,0,true,true,material)
225
	local m = Mesh(p,"Brick")
226
	q(function(pa,me)
227
		wait(5)
228
		fade(pa,0)
229
		Delay(1.25,function()pa:Destroy()end)
230
	end,{p,m})
231
end
232
function crater(origin,dist)
233
	local b = workspace.Base
234
	local bc = b and tostring(b.BrickColor) or "Bright green"
235
	local m = b and b.Material or "Grass"
236
	for i=0,360,30 do
237
		local cf = origin*CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,dist)*CFrame.Angles(math.rad(i/30),0,rand(5))
238
		placePart(cf,math.random(10,12),bc,m)
239
	end
240
end
241
function cylinderExplode(origin,color,size,ysize)
242
	local p = Part("Effect",workspace,Vector3.new(size,ysize or size,size),origin,color,.2,true,false,"SmoothPlastic")
243
	local m = Instance.new("CylinderMesh",p)
244
	q(function(pa,me)
245
		for i=.2,1,.0075 do
246
			me.Scale = me.Scale+Vector3.new(.1,0,.1)
247
			pa.Transparency = i
248
			wait(1/30)
249
		end
250
		pa:Destroy()
251
	end,{p,m})
252
end
253
function ringExplode(origin,color,size)
254
	local p = Part("Effect",workspace,Vector3.new(size,size,1),origin,color,.2,true,false,"SmoothPlastic")
255
	local m = Mesh(p,"FileMesh",Vector3.new(),asset..meshes["ring"])
256
	q(function(pa,me)
257
		for i=.2,1,.0075 do
258
			me.Scale = me.Scale-Vector3.new(0.5,0.5,0)
259
			pa.Transparency = i
260
			wait(1/30)
261
		end
262
		pa:Destroy()
263
	end,{p,m})
264
end
265
function crownExplode(origin,color,size)
266
	local p = Part("Effect",workspace,Vector3.new(size,size,size),origin,color,.2,true,false,"SmoothPlastic")
267
	local m = Mesh(p,"FileMesh",Vector3.new(size/2,size/2,size/2),asset..meshes["crown"])
268
	q(function(pa,me)
269
		for i=.2,1,.025 do
270
			me.Scale = me.Scale+Vector3.new(0.75,0.75,0.75)
271
			pa.Transparency = i
272
			wait(1/30)
273
		end
274
		pa:Destroy()
275
	end,{p,m})
276
end
277
function glitter(origin,color)
278
	local p = Part("Effect",workspace,Vector3.new(0.75,0.75,0.75),origin*CFrame.new(rand(5),rand(5),rand(5))*CFrame.Angles(rand(5),rand(5),rand(5)),color,0,true,false,"SmoothPlastic")
279
	local m = Mesh(p,"Brick",Vector3.new(1,1,1))
280
	q(function(pa,me)
281
		fade(pa,0)
282
		for i=0,1,.05 do
283
			me.Scale = me.Scale-Vector3.new(0.05,0.05,0.05)
284
			wait(1/30)
285
		end
286
		pa:Destroy()
287
	end,{p,m})
288
end
289
function quickSound(id,v)
290
	local s = Instance.new("Sound",workspace)
291
	s.SoundId = id
292
	s.PlayOnRemove = true
293
	s.Volume = v or 1
294
	delay(0.025,function()s:remove()end)
295
end
296
function checkDmgArea(origin,dmg,d)
297
	for i,v in pairs(workspace:children())do
298
		if v~=char and v:FindFirstChild("Torso") then
299
			local h;
300
			for _,k in pairs(v:children())do if k:IsA("Humanoid") then h = k end end
301
			local dist = (origin.p - v:FindFirstChild("Torso").CFrame.p).magnitude
302
			if dist < d and h~=nil then
303
				h.Health = h.Health - dmg
304
			end
305
		end
306
	end
307
end
308
function findClosestPlayer(origin,d)
309
	local bdist,plr = d,nil
310
	for i,v in pairs(workspace:children())do
311
		if v~=char and v:FindFirstChild("Torso") then
312
			local h;
313
			for _,k in pairs(v:children())do if k:IsA("Humanoid") then h = k end end
314
			local dist = (origin.p - v:FindFirstChild("Torso").CFrame.p).magnitude
315
			if dist < bdist and h~=nil and h.Health~=0 then
316
				bdist,plr = dist,v
317
			end
318
		end
319
	end
320
	return bdist,plr
321
end
322
function Shoot(start)
323
	ringExplode(CFrame.new(start.p,start.p-(start.lookVector*-4)),colour[2],.25)
324
	local vel = start.lookVector
325
	local p = Part("Bullet",workspace,Vector3.new(1,1,5),start,colour[2],0.4,true,false,"SmoothPlastic")
326
	local m = Mesh(p,"Sphere")
327
	local num = 0
328
	local ign = sword:children()
329
	local connect
330
	connect = step:connect(function()
331
		num = num + 1
332
		local pp = p.Position
333
		local h,po
334
		repeat
335
			local r = Ray.new(pp,vel.unit*math.min(999.5,vel.magnitude/30+9))
336
			h,po = workspace:FindPartOnRayWithIgnoreList(r,ign)
337
			if h then
338
				if h.CanCollide then
339
					break
340
				else
341
					table.insert(ign,h)
342
					h = nil
343
				end
344
			else
345
				break
346
			end
347
		until false
348
		p.CFrame = CFrame.new(po,po+vel)
349
		if h or num > 300 then
350
			local cf = p.CFrame
351
			q(function(cfz)
352
				for i=1,math.random(1,3)do
353
					Smoke(cfz,colour[2])
354
				end
355
				if h~=nil then
356
					local obj = h.CFrame:pointToObjectSpace(po)
357
					local siz = h.Size/2
358
					local svec = obj/siz
359
					svec = Vector3.new(math.floor(math.abs(svec.X)+.01)*svec.X/math.abs(svec.X),
360
					math.floor(math.abs(svec.Y))*svec.Y/math.abs(svec.Y) ,
361
					math.floor(math.abs(svec.Z))*svec.Z/math.abs(svec.Z))
362
				if svec.magnitude ~= 1 then return end
363
					local dir = h.CFrame:vectorToWorldSpace(svec)
364
				end
365
			end,{cf})
366
			if h and h.Parent~=char then
367
				local hum;
368
				for i,v in pairs(h.Parent:children())do if v:IsA("Humanoid")then hum = v end end
369
				if hum then hum:TakeDamage(25)end
370
			end
371
			p:Destroy()
372
			connect:disconnect()
373
		end
374
	end)
375
end
376
function headSmash(victim)
377
	if victim==nil then return end
378
	Attacking = true
379
	Mode = "Custom"
380
	cWalkS = 0
381
	r,e = pcall(function()
382
		local t = victim:FindFirstChild("Torso")
383
		local tcf = t.CFrame
384
		local bg = Instance.new("BodyGyro",torso)
385
		bg.maxTorque = Vector3.new(4e5,4e5,4e5)*20e45
386
		bg.cframe = CFrame.new(root.CFrame.p,CFrame.new(tcf.p.x,root.CFrame.p.y,tcf.p.z).p)
387
		local bp = Instance.new("BodyPosition",t)
388
		bp.maxForce = Vector3.new(4e5,4e5,4e5)*20e45
389
		bp.position = tcf.p
390
		for i=1,3 do
391
			local cf = CFrame.new(t.CFrame.x+rand(5),t.CFrame.y,t.CFrame.z+rand(5))
392
			spikeMagic(cf,4,colour[2])
393
		end
394
		for i=1,50 do
395
			wait(1/30)
396
			local speed = i/50
397
			local mpos = torso.CFrame * CFrame.new(1.5,0.5,0)
398
			local cf = CFrame.new(mpos.p,t.CFrame.p) * CFrame.Angles(math.pi/2,0,0)
399
			local x,y,z = torso.CFrame:toObjectSpace(cf):toEulerAnglesXYZ()
400
			rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(x,y,z),speed)
401
			ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(0,0,-math.pi/4),speed)
402
			handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi/2),speed)
403
			rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(0,0,0),speed)
404
			lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(0,0,0),speed)
405
			ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(-y,0,0),speed)
406
			rw.C0 = cslerp(rw.C0,c0.tw*CFrame.Angles(0,math.pi/4,0),speed)
407
			bp.position = bp.position + Vector3.new(0,1,0)
408
		end
409
		Shoot(blade.CFrame*CFrame.Angles(math.pi/2,0,0))
410
		victim:BreakJoints()
411
		bg:Destroy()
412
	end)if not r then print(e) end
413
	Attacking = false
414
	Mode = ""
415
	cWalkS = 20
416
end
417
function Swing1()
418
	Attacking = true
419
	Mode = "Custom"
420
	r,e = pcall(function()
421
		--[[for i=1,25 do
422
			wait(1/30)
423
			local speed = i/25
424
			rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(x,y,z),speed)
425
			ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(0,0,-math.pi/4),speed)
426
			handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi/2),speed)
427
			rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(0,0,0),speed)
428
			lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(0,0,0),speed)
429
			ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(-y,0,0),speed)
430
			rw.C0 = cslerp(rw.C0,c0.tw*CFrame.Angles(0,math.pi/4,0),speed)
431
		end]]
432
	end)if not r then print(e) end
433
	Attacking = false
434
	Mode = ""
435
	cWalkS = 20
436
end
437
function charge()
438
	Attacking = true
439
	Mode = "Custom"
440
	cWalkS = 0
441
	r,e = pcall(function()
442
		for i=1,75 do
443
			wait(1/30)
444
			glitter(torso.CFrame,colour[2])
445
			local speed = i/100
446
			rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(math.pi/1.75,0,-math.pi/8),speed)
447
			ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(math.pi/8,0,math.pi/4),speed)
448
			handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi*2.5),speed)
449
			rh.C0 = cslerp(rh.C0,c0.rh*CFrame.new(0,1,-.5)*CFrame.Angles(-math.pi/8,0,0),speed)
450
			lh.C0 = cslerp(lh.C0,c0.lh*CFrame.new(0,0,-.5)*CFrame.Angles(-math.pi/2,0,0),speed)
451
			ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(-math.pi/6,0,0),speed)
452
			rw.C0 = cslerp(rw.C0,c0.tw*CFrame.new(0,-1.5,0)*CFrame.Angles(0,0,0),speed)
453
		end
454
	end)if not r then print(e)end
455
	Attacking = false
456
	Mode = ""
457
	cWalkS = 20
458
end
459
---------------------------------------------
460
pcall(function()char:FindFirstChild("Sword"):Destroy()end)
461
sword = Instance.new("Model",char)
462
sword.Name = "Sword"
463
handle = Part("Handle",sword,Vector3.new(.25,2,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
464
handlew = Weld(char:WaitForChild("Right Arm"),handle,CFrame.new(0,-1.1,0)*CFrame.Angles(-math.pi/2,-math.pi/2,0))
465
p1 = WedgePart("P",sword,Vector3.new(.25,.75,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
466
p1w = Weld(handle,p1,CFrame.new(0.25,-.625,0)*CFrame.Angles(0,-math.pi/2,0))
467
p2 = WedgePart("P",sword,Vector3.new(.25,.75,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
468
p2w = Weld(handle,p2,CFrame.new(-0.25,-.625,0)*CFrame.Angles(0,math.pi/2,0))
469
p3 = Part("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
470
p3w = Weld(handle,p3,CFrame.new(.25,.75,0))
471
p4 = Part("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
472
p4w = Weld(handle,p4,CFrame.new(-.25,.75,0))
473
p5 = WedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
474
p5w = Weld(p3,p5,CFrame.new(0.25,0,0)*CFrame.Angles(math.pi,-math.pi/2,0))
475
p6 = WedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
476
p6w = Weld(p4,p6,CFrame.new(-0.25,0,0)*CFrame.Angles(math.pi,math.pi/2,0))
477
p7 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
478
p7m = Mesh(p7,"FileMesh",Vector3.new(.5,1,.4),"http://www.roblox.com/asset/?id=11294911")
479
p7w = Weld(p5,p7,CFrame.new(-.225,0,0)*CFrame.Angles(0,-math.pi/2,0))
480
p8 = WedgePart("P",sword,Vector3.new(.75,.5,0),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
481
p8w = Weld(handle,p8,CFrame.new(0,.75,.225)*CFrame.Angles(math.pi,0,0))
482
p9 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
483
p9m = Mesh(p9,"FileMesh",Vector3.new(.4,1,.5),"http://www.roblox.com/asset/?id=11294911")
484
p9w = Weld(p5,p9,CFrame.new(.225,0,0)*CFrame.Angles(0,-math.pi,0))
485
p10 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
486
p10m = Mesh(p10,"FileMesh",Vector3.new(.4,1,.5),"http://www.roblox.com/asset/?id=11294911")
487
p10w = Weld(p6,p10,CFrame.new(.225,0,0)*CFrame.Angles(0,-math.pi,0))
488
p11 = CornerWedgePart("P",sword,Vector3.new(.25,.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
489
p11m = Mesh(p11,"FileMesh",Vector3.new(.5,1,.4),"http://www.roblox.com/asset/?id=11294911")
490
p11w = Weld(p6,p11,CFrame.new(-.225,0,0)*CFrame.Angles(0,-math.pi/2,0))
491
p12 = WedgePart("P",sword,Vector3.new(.75,.5,0),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
492
p12w = Weld(handle,p12,CFrame.new(0,.75,-.225)*CFrame.Angles(-math.pi*2,0,math.pi))
493
blade = Part("Blade",sword,Vector3.new(.75,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
494
bladew = Weld(handle,blade,CFrame.new(0,7.5/2+1,0))
495
p13 = WedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
496
p13w = Weld(blade,p13,CFrame.new(-.5,0,0)*CFrame.Angles(math.pi,math.pi/2,0))
497
p14 = WedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
498
p14w = Weld(blade,p14,CFrame.new(.5,0,0)*CFrame.Angles(math.pi,-math.pi/2,0))
499
p15 = WedgePart("P",sword,Vector3.new(.25,1.5,1.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
500
p15w = Weld(blade,p15,CFrame.new(0,7.5/2+.75,0)*CFrame.Angles(0,math.pi/2,0))
501
p16 = WedgePart("P",sword,Vector3.new(.75,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
502
p16w = Weld(blade,p16,CFrame.new(0,0,-.25)*CFrame.Angles(math.pi,math.pi,0))
503
p17 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
504
p17m = Mesh(p17,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
505
p17w = Weld(p16,p17,CFrame.new(-.5,0,0)*CFrame.Angles(0,-math.pi/2,0))
506
p18 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
507
p18m = Mesh(p18,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
508
p18w = Weld(p16,p18,CFrame.new(.5,0,0)*CFrame.Angles(0,math.pi,0))
509
p19 = CornerWedgePart("P",sword,Vector3.new(.25,1.5,1.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
510
p19m = Mesh(p19,"FileMesh",Vector3.new(.5,1.5*2,1.25*2),"http://www.roblox.com/asset/?id=11294911")
511
p19w = Weld(p15,p19,CFrame.new(0.25,0,0)*CFrame.Angles(0,math.pi,0))
512
p20 = WedgePart("P",sword,Vector3.new(.75,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
513
p20w = Weld(blade,p20,CFrame.new(0,0,.25)*CFrame.Angles(math.pi,math.pi*2,0))
514
p21 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
515
p21m = Mesh(p21,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
516
p21w = Weld(p20,p21,CFrame.new(-.5,0,0)*CFrame.Angles(0,-math.pi/2,0))
517
p22 = CornerWedgePart("P",sword,Vector3.new(.25,7.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
518
p22m = Mesh(p22,"FileMesh",Vector3.new(.5,7.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
519
p22w = Weld(p20,p22,CFrame.new(.5,0,0)*CFrame.Angles(0,math.pi,0))
520
p23 = CornerWedgePart("P",sword,Vector3.new(1.25,1.5,.25),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
521
p23m = Mesh(p23,"FileMesh",Vector3.new(1.25*2,1.5*2,.5),"http://www.roblox.com/asset/?id=11294911")
522
p23w = Weld(p15,p23,CFrame.new(-.25,0,0)*CFrame.Angles(0,-math.pi/2,0))
523
p24 = Part("P",sword,Vector3.new(1.25,1,.75),torso.CFrame,colour[1],0,false,false,"SmoothPlastic")
524
p24m = Mesh(p24,"Torso",Vector3.new(1,1,.875))
525
p24w = Weld(handle,p24,CFrame.new(0,1.5,0))
526
------ effect
527
parts = {}
528
for i=1,6 do
529
	local p = Part(tostring(i),sword,Vector3.new(.25,.25,.25),torso.CFrame,colour[2],1,false,false,"SmoothPlastic")
530
	local pm = Mesh(p,"FileMesh",Vector3.new(.5+i/25,1,.375+i/25),asset..meshes.diamond)
531
	local pw = Weld(blade,p,CFrame.new(0,-4+i+1,0))
532
	table.insert(parts,p)
533
end
534
---------------------------------------------
535
ohw = handlew.C0
536
---------------------------------------------
537
mouse.Button1Down:connect(function()
538
end)
539
mouse.KeyDown:connect(function(key)
540
	key:lower()
541
	local d,p = findClosestPlayer(torso.CFrame,5)
542
	if key=="q" and not Attacking then headSmash(p)
543
	elseif key=="e" and not Attacking then charge()end
544
end)
545
mouse.KeyUp:connect(function(key)
546
end)
547
---------------------------------------------
548
count = 0
549
angle = 0
550
counttime = 70
551
countspeed = 1
552
speed = .3
553
perc = 0
554
increment = 1/#parts
555
step:connect(function()
556
	count = (count%counttime)+countspeed
557
	angle = math.pi*math.sin((math.pi*2)/counttime*count)
558
	perc = (perc%1)+0.02
559
	rootVel = Vector3.new(root.Velocity.x,0,root.Velocity.z)
560
	-----------------------------
561
	for i,v in pairs(parts)do v.Transparency = math.sin(math.pi*((perc+increment*i)%1))end
562
	humanoid.WalkSpeed = cWalkS
563
	if (tick()-lastpulse) > pulsetime then
564
		lastpulse = tick()
565
		ringExplode(CFrame.new(torso.CFrame.x,1,torso.CFrame.z)*CFrame.Angles(math.pi/2,0,0),colour[1],4)
566
	end
567
	-----------------------------
568
	if Mode=="Custom"or rootVel.magnitude > 2 then
569
		--- debug
570
		isIdlePosing,curIdle,lastIdle = false,"",tick()
571
		--- end debug
572
	end
573
	if rootVel.magnitude < 2 and Mode~="Custom" then
574
		counttime = 50
575
		countspeed = .5
576
		speed = .1
577
		if (tick()-lastIdle) > bIdleTime and not isIdlePosing then curIdle = Idles[math.random(1,#Idles)] startedIdle = tick() isIdlePosing = true end
578
		if isIdlePosing and (tick()-startedIdle) > bIdleTime/2 then isIdlePosing = false curIdle = "" lastIdle = tick() end
579
		if curIdle=="" then
580
			rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(math.pi/3+angle*speed*.1,0,-.1),speed)
581
			ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(-angle*speed*.2,0,0),speed)
582
			handlew.C0 = cslerp(handlew.C0,ohw*CFrame.new(1,.6,0.3)*CFrame.Angles(0,-math.pi/9,-math.pi/2),speed)
583
			rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(-angle*speed*.2,0,0),speed)
584
			lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(angle*speed*.2,0,0),speed)
585
			ne.C0 = cslerp(ne.C0,c0.nk,speed)
586
			rw.C0 = cslerp(rw.C0,c0.tw,speed)
587
		elseif curIdle=="FAB" then
588
			rs.C0 = cslerp(rs.C0,c0.rs*CFrame.new(0,.5,0)*CFrame.Angles(-math.pi,0,math.pi/6),speed)
589
			ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(0,0,-math.pi/8),speed)
590
			handlew.C0 = cslerp(handlew.C0,ohw*CFrame.Angles(0,0,math.pi*2.5),speed)
591
			rh.C0 = cslerp(rh.C0,c0.rh*CFrame.Angles(0,0,math.pi/10),speed)
592
			lh.C0 = cslerp(lh.C0,c0.lh*CFrame.Angles(0,0,-math.pi/10),speed)
593
			ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(math.pi/6,-math.pi/4,0),speed)
594
			rw.C0 = cslerp(rw.C0,c0.tw,speed)
595
		end
596
	elseif rootVel.magnitude > 2 and Mode~="Custom" then
597
		counttime = 25
598
		countspeed = 1.5
599
		speed = .4
600
		rs.C0 = cslerp(rs.C0,c0.rs*CFrame.Angles(math.pi/3+angle*speed*.1,0,-.1),speed)
601
		ls.C0 = cslerp(ls.C0,c0.ls*CFrame.Angles(math.pi/8+angle*speed,0,math.pi/8*angle*speed),speed)
602
		handlew.C0 = cslerp(handlew.C0,ohw*CFrame.new(1,.6,0.3)*CFrame.Angles(0,-math.pi/9,-math.pi/2),speed)
603
		lh.C0 = cslerp(lh.C0,c0.lh*CFrame.new(0,-angle*speed*.3,0)*CFrame.Angles(-angle*speed*.75,0,-angle*speed*.1),speed)
604
		rh.C0 = cslerp(rh.C0,c0.rh*CFrame.new(0,angle*speed*.3,0)*CFrame.Angles(angle*speed*.75,0,-angle*speed*.1),speed)
605
		ne.C0 = cslerp(ne.C0,c0.nk*CFrame.Angles(math.pi/17,angle*speed*.025,0),speed)
606
		rw.C0 = cslerp(rw.C0,c0.tw*CFrame.Angles(-math.pi/20,angle*speed*.05,0),speed)
607
	end
608
end)