View difference between Paste ID: vrj12wQp and DwzJ3a46
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-
me = game.Players.LocalPlayer
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
Script shared by eletronix                                              ]]
154
155
me = owner
156
char = me.Character
157
bin = script.Parent
158
selected = false
159
attacking = false
160
hurt = false
161
deb = true
162
normdmg = 18
163
dmg = normdmg
164
fly = false
165
firecols = {"Bright violet", "Black", "Really black"}
166
167
parts = {}
168
169
if char:findFirstChild("Scythe",true) ~= nil then
170
        char:findFirstChild("Scythe",true).Parent = nil
171
end
172
173
function prop(part, parent, collide, tran, ref, x, y, z, color, anchor, form)
174
part.Parent = parent
175
part.formFactor = form
176
part.CanCollide = collide
177
part.Transparency = tran
178
part.Reflectance = ref
179
part.Size = Vector3.new(x,y,z)
180
part.BrickColor = BrickColor.new(color)
181
part.TopSurface = 0
182
part.BottomSurface = 0
183
part.Anchored = anchor
184
part.Locked = true
185
part:BreakJoints()
186
end
187
188
function weld(w, p, p1, a, b, c, x, y, z)
189
w.Parent = p
190
w.Part0 = p
191
w.Part1 = p1
192
w.C1 = CFrame.fromEulerAnglesXYZ(a,b,c) * CFrame.new(x,y,z)
193
end
194
195
function mesh(mesh, parent, x, y, z, type)
196
mesh.Parent = parent
197
mesh.Scale = Vector3.new(x, y, z)
198
mesh.MeshType = type
199
end
200
201
function getcharparts(path)
202
        local objs = {}
203
        for _,v in pairs(path:children()) do
204
                if v:IsA("Model") and v.Name ~= name then
205
                        for _,k in pairs(v:children()) do
206
                                if k.Name == "Torso" then
207
                                        table.insert(objs,k)
208
                                end
209
                        end
210
                end
211
        end
212
        return objs
213
end
214
215
sword = Instance.new("Model",me.Character)
216
sword.Name = "Scythe"
217
218
--Parts-------------------------Parts-------------------------Parts-------------------------Parts----------------------
219
220
rarm = char:findFirstChild("Right Arm")
221
larm = char:findFirstChild("Left Arm")
222
torso = char:findFirstChild("Torso")
223
hum = char:findFirstChild("Humanoid")
224
225
main = Instance.new("Part")
226
prop(main, sword, false, 0, 0, 0.45, 6.4, 0.45, "Really black", false, "Custom")
227
mme = Instance.new("SpecialMesh")
228
mesh(mme,main,1,1,1,"Head")
229
table.insert(parts,main)
230
231
part1 = Instance.new("Part")
232
prop(part1, sword, false, 0, 0, 0.45, 1, 0.45, "Really black", false, "Custom")
233
p1m = Instance.new("SpecialMesh")
234
mesh(p1m,part1,1,1,1,"Head")
235
w1 = Instance.new("Weld")
236
weld(w1, main, part1, 0, 0, -1.1, -0.3, 3.3, 0)
237
238
part2 = Instance.new("Part")
239
prop(part2, sword, false, 0, 0, 0.45, 1, 0.45, "Really black", false, "Custom")
240
p2m = Instance.new("SpecialMesh")
241
mesh(p2m,part2,1,1,1,"Head")
242
w2 = Instance.new("Weld")
243
weld(w2, main, part2, 0, 0, -1.1, 0.3, -3.3, 0)
244
245
blade1 = Instance.new("Part")
246
prop(blade1, sword, false, 0, 0, 1.4, 0.8, 0.1, "Dark grey", false, "Custom")
247
b1m = Instance.new("BlockMesh",blade1)
248
w3 = Instance.new("Weld")
249
weld(w3, main, blade1, 0, 0, -0.4, -0.45, -3.4, 0)
250
table.insert(parts,blade1)
251
252
blade2 = Instance.new("Part")
253
prop(blade2, sword, false, 0, 0, 1.1, 0.8, 0.1, "Dark grey", false, "Custom")
254
b2m = Instance.new("BlockMesh",blade2)
255
w4 = Instance.new("Weld")
256
weld(w4, main, blade2, 0, 0, 0, -1.5, -3.66, 0)
257
table.insert(parts,blade2)
258
259
blade3 = Instance.new("Part")
260
prop(blade3, sword, false, 0, 0, 0.1, 0.8, 1.7, "Dark grey", false, "Custom")
261
b3m = Instance.new("SpecialMesh")
262
mesh(b3m,blade3,1,1,1,"Wedge")
263
w5 = Instance.new("Weld")
264
weld(w5, main, blade3, 0, math.pi/2, 0.4, -2.64, -3.38, 0)
265
table.insert(parts,blade3)
266
267
blade1b = Instance.new("Part")
268
prop(blade1b, sword, false, 0, 0, 1.4, 0.8, 0.1, "Dark grey", false, "Custom")
269
b1mb = Instance.new("BlockMesh",blade1b)
270
w6 = Instance.new("Weld")
271
weld(w6, main, blade1b, 0, 0, -0.4+math.pi, 0.45, 3.4, 0)
272
table.insert(parts,blade1b)
273
274
blade2b = Instance.new("Part")
275
prop(blade2b, sword, false, 0, 0, 1.1, 0.8, 0.1, "Dark grey", false, "Custom")
276
b2mb = Instance.new("BlockMesh",blade2b)
277
w7 = Instance.new("Weld")
278
weld(w7, main, blade2b, 0, 0, math.pi, 1.5, 3.66, 0)
279
table.insert(parts,blade2b)
280
281
blade3b = Instance.new("Part")
282
prop(blade3b, sword, false, 0, 0, 0.1, 0.8, 1.7, "Dark grey", false, "Custom")
283
b3mb = Instance.new("SpecialMesh")
284
mesh(b3mb,blade3b,1,1,1,"Wedge")
285
w8 = Instance.new("Weld")
286
weld(w8, main, blade3b, 0, math.pi/2, 0.4+math.pi, 2.64, 3.38, 0)
287
table.insert(parts,blade3b)
288
289
for i=0.9, 1.6, 0.09 do
290
hp1 = Instance.new("Part")
291
prop(hp1, sword, false, 0, 0, 0.48, 0.09, 0.48, "White", false, "Custom")
292
h1m = Instance.new("SpecialMesh")
293
mesh(h1m,hp1,1,1,1,"Head")
294
w9 = Instance.new("Weld")
295
weld(w9, main, hp1, math.random(-20,20)/100, 0, math.random(-20,20)/100, 0, i, 0)
296
end
297
298
for i=0.9, 1.6, 0.09 do
299
hp2 = Instance.new("Part")
300
prop(hp2, sword, false, 0, 0, 0.48, 0.09, 0.48, "White", false, "Custom")
301
h2m = Instance.new("SpecialMesh")
302
mesh(h2m,hp2,1,1,1,"Head")
303
w10 = Instance.new("Weld")
304
weld(w10, main, hp2, math.random(-20,20)/100, 0, math.random(-20,20)/100, 0, -i, 0)
305
end
306
307
--Arm joints-----------------------Arm joints-----------------------Arm joints---------------------
308
309
righthold = Instance.new("Part")
310
prop(righthold, sword, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
311
w11 = Instance.new("Weld")
312
weld(w11, rarm, righthold, 0, 0, 0, 0, 1, 0)
313
314
lefthold = Instance.new("Part")
315
prop(lefthold, sword, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
316
w12 = Instance.new("Weld")
317
weld(w12, larm, lefthold, 0, 0, 0, 0, 1, 0)
318
319
rb = Instance.new("Part")
320
prop(rb, sword, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
321
w13 = Instance.new("Weld")
322
weld(w13, torso, rb, 0, 0, 0, -1.5, -0.5, 0)
323
324
lb = Instance.new("Part")
325
prop(lb, sword, false, 1, 0, 0.1, 0.1, 0.1, "White", false, "Custom")
326
w14 = Instance.new("Weld")
327
weld(w14, torso, lb, 0, 0, 0, 1.5, -0.5, 0)
328
329
rw = Instance.new("Weld")
330
weld(rw, rb, nil, 0, 0, 0, 0, 0.5, 0)
331
332
lw = Instance.new("Weld")
333
weld(lw, lb, nil, 0, 0, 0, 0, 0.5, 0)
334
335
336
holdweld = Instance.new("Weld")
337
weld(holdweld,torso,main,0,0,0.85,0,0,-0.64)
338
339
rh = Instance.new("Weld")
340
weld(rh,righthold,nil,math.pi/2,0,math.pi,0,0,1)
341
342
lh = Instance.new("Weld")
343
weld(lh,lefthold,nil,math.pi/2,0,0,0,0,0)
344
345
rightbattle = nil
346
leftbattle = nil
347
348
if script.Parent.className ~= "HopperBin" then
349
        h = Instance.new("HopperBin",me.Backpack)
350
        h.Name = "Scythe"
351
        script.Parent = h
352
end
353
354
bin = script.Parent
355
356
function selectmotion()
357
        rw.Part1 = rarm
358
        rh.C0 = CFrame.new(0,0,0)
359
        rw.C0 = CFrame.new(0,0,0)
360
        lw.C0 = CFrame.new(0,0,0)
361
        for i=1, 7 do
362
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.25,0.13,-0.1)
363
                wait()
364
        end
365
        rh.Part1 = main
366
        holdweld.Part1 = nil
367
        for i=1, 5 do
368
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.3,0,-0.1)
369
                rh.C0 = rh.C0 * CFrame.new(0,0,0.4) * CFrame.fromEulerAnglesXYZ(0,0,-(math.pi/2)/5)
370
                wait()
371
        end
372
        lw.Part1 = larm
373
        for i=1, 5 do
374
                rw.C0 = rw.C0 * CFrame.new(-0.03,0.05,0.08) * CFrame.fromEulerAnglesXYZ(-0.3,-0.2,0.13)
375
                lw.C0 = lw.C0 * CFrame.new(0.08,0,0) * CFrame.fromEulerAnglesXYZ(0.2,0,0)
376
                wait()
377
        end
378
        rightbattle = rw.C0
379
        leftbattle = lw.C0
380
        rh.Part1 = main
381
        lw.Part1 = larm
382
        rw.C0 = rightbattle
383
        lw.C0 = leftbattle
384
        selected = true
385
end
386
387
function deselmotion()
388
        selected = false
389
        rightbattle = rw.C0
390
        leftbattle = lw.C0
391
        rh.Part1 = main
392
        lw.Part1 = larm
393
        rw.Part1 = rarm
394
        rw.C0 = rightbattle
395
        lw.C0 = leftbattle
396
        for i=1, 5 do
397
                rw.C0 = rw.C0 * CFrame.new(0.03,-0.05,-0.08) * CFrame.fromEulerAnglesXYZ(0.3,0.2,-0.13)
398
                lw.C0 = lw.C0 * CFrame.new(-0.08,0,0) * CFrame.fromEulerAnglesXYZ(-0.2,0,0)
399
                wait()
400
        end
401
        lw.Part1 = nil
402
        for i=1, 5 do
403
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.3,0,0.1)
404
                rh.C0 = rh.C0 * CFrame.new(0,0,-0.4) * CFrame.fromEulerAnglesXYZ(0,0,(math.pi/2)/5)
405
                wait()
406
        end
407
        holdweld.Part1 = main
408
        rh.Part1 = nil
409
        for i=1, 7 do
410
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.25,-0.13,0.1)
411
                wait()
412
        end
413
        rw.Part1 = nil
414
        lw.Part1 = nil
415
        rh.C0 = CFrame.new(0,0,0)
416
        rw.C0 = CFrame.new(0,0,0)
417
        lw.C0 = CFrame.new(0,0,0)
418
end
419
420
--Effect------------------Effect------------------Effect------------------Effect------------------Effect----------------
421
422
function effect()
423
        for _,v in pairs(parts) do
424
                local o = v:clone()
425
                o.Parent = workspace
426
                o.Transparency = 0.6
427
                o.BrickColor = BrickColor.new("Bright violet")
428
                o.Anchored = true
429
                o.CanCollide = false
430
                o.CFrame = v.CFrame
431
                coroutine.resume(coroutine.create(function()
432
                        for i=o.Transparency, 1, 0.07 do
433
                                wait()
434
                                o.Transparency = i
435
                        end
436
                        o:remove()
437
                end))
438
        end
439
end
440
441
--KILL FUNCTION-------------KILL FUNCTION-------------KILL FUNCTION-------------KILL FUNCTION-----------
442
443
444
function kill(h)
445
        if hurt and deb then
446
                local hu = h.Parent:findFirstChild("Humanoid")
447
                if hu ~= nil and h.Parent.Name ~= name then
448
                        deb = false
449
                        local dam = math.random(0,dmg)
450
                        hu.Health = hu.Health - dam
451
                        local p = Instance.new("Part")
452
                        prop(p,nil,false,1,0,0.9,0.25,0.9,"Bright red",false,"Custom")
453
                        p.CFrame = CFrame.new(blade3b.Position) * CFrame.new(0,2,0)
454
                        local bil = Instance.new("BillboardGui",p)
455
                        bil.Adornee = bil.Parent
456
                        bil.Size = UDim2.new(0,60,0,60)
457
                        local txt = Instance.new("TextLabel",bil)
458
                        txt.Text = dam
459
                        txt.BackgroundTransparency = 1
460
                        txt.FontSize = "Size24"
461
                        txt.Size = UDim2.new(0,60,0,60)
462
                        local bp = Instance.new("BodyPosition",p)
463
                        bp.maxForce = Vector3.new(math.huge,math.huge,math.huge)
464
                        bp.P = 200000
465
                        bp.position = p.Position
466
                        local po = bp.position
467
                        local cf = CFrame.Angles(0,0,0)
468
                        if fly then
469
                                local too = h.Parent:findFirstChild("Torso")
470
                                if too ~= nil then
471
                                        coroutine.resume(coroutine.create(function()
472
                                                hu.PlatformStand = true
473
                                                wait(0.06)
474
                                                local c = CFrame.new(torso.Position, too.Position)
475
                                                too.Velocity = c.lookVector * math.random(30,70)
476
                                                wait(0.6)
477
                                                hu.PlatformStand = false
478
                                        end))
479
                                end
480
                        end
481
                        coroutine.resume(coroutine.create(function()
482
                                p.Parent = workspace
483
                                for i=0, math.random(16,27), 0.35 do
484
                                        wait()
485
                                        cf = CFrame.Angles(0,i/1.3,0) * CFrame.new(0,i/1.7,i/3.2)
486
                                        bp.position = po + cf.p
487
                                end
488
                                p:remove()
489
                        end))
490
                        coroutine.resume(coroutine.create(function()
491
                                wait(0.14)
492
                                deb = true
493
                        end))
494
                end
495
        end
496
end
497
498
for _,v in pairs(parts) do
499
        v.Touched:connect(kill)
500
end
501
502
--Attacks-----------Attacks----------------Attacks-----------Attacks----------------Attacks-----------Attacks--------------
503
504
function att()
505
        attacking = true
506
        for i=1,7 do
507
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.05,-0.2,-0.05)
508
                lw.C0 = lw.C0 * CFrame.new(0.07,-0.08,0) * CFrame.fromEulerAnglesXYZ(0,0,0.12)
509
                wait()
510
        end
511
        for i=1,6 do
512
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.3,0,0.05)
513
                lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.2,0,0.1)
514
                wait()
515
        end
516
        hurt = true
517
        for i=1,6 do
518
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.5,-0.06,0.12)
519
                lw.C0 = lw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.23,-0.07,0)
520
                effect()
521
                wait()
522
        end
523
        hurt = false
524
        for i=1,6 do
525
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.13,0.23,-0.2)
526
                lw.C0 = lw.C0 * CFrame.new(-0.08,0.09,0.03) * CFrame.fromEulerAnglesXYZ(-0.1,0.15,-0.15)
527
                effect()
528
                wait()
529
        end
530
        rw.C0 = rightbattle
531
        lw.C0 = leftbattle
532
        attacking = false
533
end
534
535
function throw()
536
        attacking = true
537
        for i=1,7 do
538
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.08,-0.14,-0.2)
539
                wait()
540
        end
541
        for i=1,3 do
542
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(-0.2,-0,0)
543
                effect()
544
                wait()
545
        end
546
        for i=1,4 do
547
                rw.C0 = rw.C0 * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0.45,-0,0)
548
                effect()
549
                wait()
550
        end
551
        rh.Part1 = nil
552
        local bv = Instance.new("BodyVelocity",main)
553
        bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
554
        bv.velocity = torso.CFrame.lookVector * 70
555
        local bav = Instance.new("BodyAngularVelocity",main)
556
        bav.P = 10000
557
        bav.angularvelocity = torso.CFrame.lookVector * 40
558
        local lolpos = torso.CFrame
559
        wait(0.4)
560
        hurt = true
561
        dmg = 65
562
        coroutine.resume(coroutine.create(function()
563
                repeat wait() effect() until (main.Position - torso.Position).magnitude < 11
564
                rh.Part1 = main
565
                bv:remove()
566
                bav:remove()
567
                rw.C0 = rightbattle
568
                lw.C0 = leftbattle
569
                attacking = false
570
                hurt = false
571
                dmg = normdmg
572
        end))
573
        wait(3)
574
        bv.velocity = lolpos.lookVector * -180
575
end
576
577
function spin()
578
        attacking = true
579
        wait(0.1)
580
        local bg = Instance.new("BodyGyro",torso)
581
        bg.P = 13000
582
        bg.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
583
        local cf = CFrame.Angles(0,0,0)
584
        local xd = torso.CFrame
585
        bg.cframe = CFrame.new(torso.Position, xd * cf * CFrame.new(0,0,-90).p)
586
        for i=1,4 do
587
                rw.C0 = rw.C0 * CFrame.new(0,0.1,0) * CFrame.fromEulerAnglesXYZ(0.35,0,-0.07)
588
                lw.C0 = lw.C0 * CFrame.new(0,0.1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
589
                wait()
590
        end
591
        hurt = true
592
        fly = true
593
        for i=0,math.pi*4,math.pi/6 do
594
                wait()
595
                cf = CFrame.Angles(0,-i,0)
596
                bg.cframe = CFrame.new(torso.Position, xd * cf * CFrame.new(0,0,-90).p)
597
                effect()
598
        end
599
        hurt = false
600
        fly = false
601
        bg:remove()
602
        for i=1,4 do
603
                rw.C0 = rw.C0 * CFrame.new(0,-0.1,0) * CFrame.fromEulerAnglesXYZ(-0.35,0,0.07)
604
                lw.C0 = lw.C0 * CFrame.new(0,-0.1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
605
                wait()
606
        end
607
        rw.C0 = rightbattle
608
        lw.C0 = leftbattle
609
        wait(0.2)
610
        attacking = false
611
end
612
613
function select(mouse)
614
        repeat wait() until selected == false and attacking == false
615
        if selected == false then
616
                selectmotion()
617
        end
618
        coroutine.resume(coroutine.create(function()
619
                while selected do
620
                        wait(0.25)
621
                        if torso.RotVelocity.Y < -14 and attacking == false then
622
                                spin()
623
                        end
624
                end
625
        end))
626
        mouse.Button1Down:connect(function()
627
                if selected and attacking == false then
628
                        att()
629
                end
630
        end)
631
        mouse.KeyDown:connect(function(kai)
632
                if attacking == false then
633
                        omg = kai:lower()
634
                        if omg == "r" then
635
                                throw()
636
                        end
637
                end
638
        end)
639
end
640
641
function desel()
642
        repeat wait() until selected and attacking == false
643
        if selected then
644
                deselmotion()
645
        end
646
end
647
648
bin.Selected:connect(select)
649
bin.Deselected:connect(desel)
650
651
--mediafire