View difference between Paste ID: VtH09S6a and L456BJe9
SHOW: | | - or go back to the newest paste.
1
2-
--||			   CREATED BY SHACKLUSTER
2+
3-
--\\====================================================//--
3+
4
Cam = workspace.CurrentCamera
5-
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
5+
6-
local Player,game,owner = owner,game
6+
7-
local RealPlayer = Player
7+
8-
do
8+
9-
	print("FE Compatibility code by Mokiros")
9+
10-
	local rp = RealPlayer
10+
11-
	script.Parent = rp.Character
11+
12-
	
12+
13-
	--RemoteEvent for communicating
13+
14-
	local Event = Instance.new("RemoteEvent")
14+
15-
	Event.Name = "UserInput_Event"
15+
16
RootJoint = RootPart["RootJoint"]
17-
	--Fake event to make stuff like Mouse.KeyDown work
17+
18-
	local function fakeEvent()
18+
19-
		local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
19+
20-
		t.connect = t.Connect
20+
21-
		return t
21+
22
23
IT = Instance.new
24-
	--Creating fake input objects with fake variables
24+
25-
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
25+
26-
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
26+
27-
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
27+
28-
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
28+
29-
	end}
29+
30-
	--Merged 2 functions into one by checking amount of arguments
30+
31-
	CAS.UnbindAction = CAS.BindAction
31+
32
COS = math.cos
33-
	--This function will trigger the events that have been :Connect()'ed
33+
34-
	local function te(self,ev,...)
34+
35-
		local t = m[ev]
35+
36-
		if t and t._fakeEvent then
36+
37-
			for _,f in pairs(t.Functions) do
37+
38-
				f(...)
38+
39
40
--//=================================\\
41
--|| 	      USEFUL VALUES
42-
	m.TrigEvent = te
42+
43-
	UIS.TrigEvent = te
43+
44
Animation_Speed = 3
45-
	Event.OnServerEvent:Connect(function(plr,io)
45+
46-
	    if plr~=rp then return end
46+
47-
		m.Target = io.Target
47+
48-
		m.Hit = io.Hit
48+
49-
		if not io.isMouse then
49+
50-
			local b = io.UserInputState == Enum.UserInputState.Begin
50+
51-
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
51+
52-
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
52+
53
local ATTACK = false
54-
			for _,t in pairs(CAS.Actions) do
54+
55-
				for _,k in pairs(t.Keys) do
55+
56-
					if k==io.KeyCode then
56+
57-
						t.Function(t.Name,io.UserInputState,io)
57+
58
local SINE = 0
59
local KEYHOLD = false
60
local CHANGE = 2 / Animation_Speed
61-
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
61+
62-
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
62+
63-
	    end
63+
64
local ROBLOXIDLEANIMATION = IT("Animation")
65-
	Event.Parent = NLS([==[
65+
66-
	local Player = game:GetService("Players").LocalPlayer
66+
67-
	local Event = script:WaitForChild("UserInput_Event")
67+
68
local WEAPONGUI = IT("ScreenGui", PlayerGui)
69-
	local Mouse = Player:GetMouse()
69+
70-
	local UIS = game:GetService("UserInputService")
70+
71-
	local input = function(io,a)
71+
72-
		if a then return end
72+
73-
		--Since InputObject is a client-side instance, we create and pass table instead
73+
74-
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
74+
75
local CUSTOMANGLES = true
76-
	UIS.InputBegan:Connect(input)
76+
77-
	UIS.InputEnded:Connect(input)
77+
78
--\\=================================//
79-
	local h,t
79+
80-
	--Give the server mouse data 30 times every second, but only if the values changed
80+
81-
	--If player is not moving their mouse, client won't fire events
81+
82-
	while wait(1/30) do
82+
83-
		if h~=Mouse.Hit or t~=Mouse.Target then
83+
84-
			h,t=Mouse.Hit,Mouse.Target
84+
85-
			Event:FireServer({isMouse=true,Target=t,Hit=h})
85+
86
ArtificialHB.Name = "ArtificialHB"
87-
	end]==],Player.Character)
87+
88
script:WaitForChild("ArtificialHB")
89-
	----Sandboxed game object that allows the usage of client-side methods and services
89+
90-
	--Real game object
90+
91-
	local _rg = game
91+
92
allowframeloss = false
93-
	--Metatable for fake service
93+
94-
	local fsmt = {
94+
95-
		__index = function(self,k)
95+
96-
			local s = rawget(self,"_RealService")
96+
97-
			if s then return s[k] end
97+
98-
		end,
98+
99-
		__newindex = function(self,k,v)
99+
100-
			local s = rawget(self,"_RealService")
100+
101-
			if s then s[k]=v end
101+
102-
		end,
102+
103-
		__call = function(self,...)
103+
104-
			local s = rawget(self,"_RealService")
104+
105-
			if s then return s(...) end
105+
106
			end
107-
	}
107+
108-
	local function FakeService(t,RealService)
108+
109-
		t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
109+
110-
		return setmetatable(t,fsmt)
110+
111
		else
112
			tf = tf - frame * math.floor(tf / frame)
113-
	--Fake game object
113+
114-
	local g = {
114+
115-
		GetService = function(self,s)
115+
116-
			return self[s]
116+
117-
		end,
117+
118-
		Players = FakeService({
118+
119-
			LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
119+
120-
		},"Players"),
120+
121-
		UserInputService = FakeService(UIS,"UserInputService"),
121+
122-
		ContextActionService = FakeService(CAS,"ContextActionService"),
122+
123-
	}
123+
124-
	rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
124+
125-
	g.service = g.GetService
125+
126-
	
126+
127-
	g.RunService = FakeService({
127+
128-
		RenderStepped = _rg:GetService("RunService").Heartbeat,
128+
129-
		BindToRenderStep = function(self,name,_,fun)
129+
130-
			self._btrs[name] = self.Heartbeat:Connect(fun)
130+
131-
		end,
131+
132-
		UnbindFromRenderStep = function(self,name)
132+
133-
			self._btrs[name]:Disconnect()
133+
134-
		end,
134+
135-
	},"RunService")
135+
136
	if NUMBER <= 0 then
137-
	setmetatable(g,{
137+
138-
		__index=function(self,s)
138+
139-
			return _rg:GetService(s) or typeof(_rg[s])=="function"
139+
140-
			and function(_,...)return _rg[s](_rg,...)end or _rg[s]
140+
141-
		end,
141+
142-
		__newindex = fsmt.__newindex,
142+
143-
		__call = fsmt.__call
143+
144-
	})
144+
145-
	--Changing owner to fake player object to support owner:GetMouse()
145+
146-
	game,owner = g,g.Players.LocalPlayer
146+
147
			ArtificialHB.Event:wait()
148-
print("VengefulProgram is sexy from dreamer no homo")
148+
149
	end
150
end
151
152
function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
153
	local NEWMESH = IT(MESH)
154
	if MESH == "SpecialMesh" then
155
		NEWMESH.MeshType = MESHTYPE
156
		if MESHID ~= "nil" and MESHID ~= "" then
157
			NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
158
		end
159
		if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
160
			NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
161
		end
162
	end
163
	NEWMESH.Offset = OFFSET or VT(0, 0, 0)
164
	NEWMESH.Scale = SCALE
165
	NEWMESH.Parent = PARENT
166
	return NEWMESH
167
end
168
169
function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
170
	local NEWPART = IT("Part")
171
	NEWPART.formFactor = FORMFACTOR
172
	NEWPART.Reflectance = REFLECTANCE
173
	NEWPART.Transparency = TRANSPARENCY
174
	NEWPART.CanCollide = false
175
	NEWPART.Locked = true
176
	NEWPART.Anchored = true
177
	if ANCHOR == false then
178
		NEWPART.Anchored = false
179
	end
180
	NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
181
	NEWPART.Name = NAME
182
	NEWPART.Size = SIZE
183
	NEWPART.Position = Torso.Position
184
	NEWPART.Material = MATERIAL
185
	NEWPART:BreakJoints()
186
	NEWPART.Parent = PARENT
187
	return NEWPART
188
end
189
190
	local function weldBetween(a, b)
191
	    local weldd = Instance.new("ManualWeld")
192
	    weldd.Part0 = a
193
	    weldd.Part1 = b
194
	    weldd.C0 = CFrame.new()
195
	    weldd.C1 = b.CFrame:inverse() * a.CFrame
196
	    weldd.Parent = a
197
	    return weldd
198
	end
199
200
201
function QuaternionFromCFrame(cf)
202
	local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
203
	local trace = m00 + m11 + m22
204
	if trace > 0 then 
205
		local s = math.sqrt(1 + trace)
206
		local recip = 0.5 / s
207
		return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
208
	else
209
		local i = 0
210
		if m11 > m00 then
211
			i = 1
212
		end
213
		if m22 > (i == 0 and m00 or m11) then
214
			i = 2
215
		end
216
		if i == 0 then
217
			local s = math.sqrt(m00 - m11 - m22 + 1)
218
			local recip = 0.5 / s
219
			return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
220
		elseif i == 1 then
221
			local s = math.sqrt(m11 - m22 - m00 + 1)
222
			local recip = 0.5 / s
223
			return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
224
		elseif i == 2 then
225
			local s = math.sqrt(m22 - m00 - m11 + 1)
226
			local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
227
		end
228
	end
229
end
230
 
231
function QuaternionToCFrame(px, py, pz, x, y, z, w)
232
	local xs, ys, zs = x + x, y + y, z + z
233
	local wx, wy, wz = w * xs, w * ys, w * zs
234
	local xx = x * xs
235
	local xy = x * ys
236
	local xz = x * zs
237
	local yy = y * ys
238
	local yz = y * zs
239
	local zz = z * zs
240
	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))
241
end
242
 
243
function QuaternionSlerp(a, b, t)
244
	local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
245
	local startInterp, finishInterp;
246
	if cosTheta >= 0.0001 then
247
		if (1 - cosTheta) > 0.0001 then
248
			local theta = ACOS(cosTheta)
249
			local invSinTheta = 1 / SIN(theta)
250
			startInterp = SIN((1 - t) * theta) * invSinTheta
251
			finishInterp = SIN(t * theta) * invSinTheta
252
		else
253
			startInterp = 1 - t
254
			finishInterp = t
255
		end
256
	else
257
		if (1 + cosTheta) > 0.0001 then
258
			local theta = ACOS(-cosTheta)
259
			local invSinTheta = 1 / SIN(theta)
260
			startInterp = SIN((t - 1) * theta) * invSinTheta
261
			finishInterp = SIN(t * theta) * invSinTheta
262
		else
263
			startInterp = t - 1
264
			finishInterp = t
265
		end
266
	end
267
	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
268
end
269
270
function Clerp(a, b, t)
271
	local qa = {QuaternionFromCFrame(a)}
272
	local qb = {QuaternionFromCFrame(b)}
273
	local ax, ay, az = a.x, a.y, a.z
274
	local bx, by, bz = b.x, b.y, b.z
275
	local _t = 1 - t
276
	return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
277
end
278
279
function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
280
	local frame = IT("Frame")
281
	frame.BackgroundTransparency = TRANSPARENCY
282
	frame.BorderSizePixel = BORDERSIZEPIXEL
283
	frame.Position = POSITION
284
	frame.Size = SIZE
285
	frame.BackgroundColor3 = COLOR
286
	frame.BorderColor3 = BORDERCOLOR
287
	frame.Name = NAME
288
	frame.Parent = PARENT
289
	return frame
290
end
291
292
function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
293
	local label = IT("TextLabel")
294
	label.BackgroundTransparency = 1
295
	label.Size = UD2(1, 0, 1, 0)
296
	label.Position = UD2(0, 0, 0, 0)
297
	label.TextColor3 = TEXTCOLOR
298
	label.TextStrokeTransparency = STROKETRANSPARENCY
299
	label.TextTransparency = TRANSPARENCY
300
	label.FontSize = TEXTFONTSIZE
301
	label.Font = TEXTFONT
302
	label.BorderSizePixel = BORDERSIZEPIXEL
303
	label.TextScaled = false
304
	label.Text = TEXT
305
	label.Name = NAME
306
	label.Parent = PARENT
307
	return label
308
end
309
310
function NoOutlines(PART)
311
	PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
312
end
313
314
function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
315
	local NEWWELD = IT(TYPE)
316
	NEWWELD.Part0 = PART0
317
	NEWWELD.Part1 = PART1
318
	NEWWELD.C0 = C0
319
	NEWWELD.C1 = C1
320
	NEWWELD.Parent = PARENT
321
	return NEWWELD
322
end
323
324
local S = IT("Sound")
325
function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
326
	local NEWSOUND = nil
327
	coroutine.resume(coroutine.create(function()
328
		NEWSOUND = S:Clone()
329
		NEWSOUND.Parent = PARENT
330
		NEWSOUND.Volume = VOLUME
331
		NEWSOUND.Pitch = PITCH
332
		NEWSOUND.SoundId = "rbxassetid://"..ID
333
		NEWSOUND:play()
334
		if DOESLOOP == true then
335
			NEWSOUND.Looped = true
336
		else
337
			repeat wait(1) until NEWSOUND.Playing == false
338
			NEWSOUND:remove()
339
		end
340
	end))
341
	return NEWSOUND
342
end
343
344
function CFrameFromTopBack(at, top, back)
345
	local right = top:Cross(back)
346
	return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
347
end
348
349
--WACKYEFFECT({EffectType = "", Size = VT(1,1,1), Size2 = VT(0,0,0), Transparency = 0, Transparency2 = 1, CFrame = CF(), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
350
function WACKYEFFECT(Table)
351
	local TYPE = (Table.EffectType or "Sphere")
352
	local SIZE = (Table.Size or VT(1,1,1))
353
	local ENDSIZE = (Table.Size2 or VT(0,0,0))
354
	local TRANSPARENCY = (Table.Transparency or 0)
355
	local ENDTRANSPARENCY = (Table.Transparency2 or 1)
356
	local CFRAME = (Table.CFrame or Torso.CFrame)
357
	local MOVEDIRECTION = (Table.MoveToPos or nil)
358
	local ROTATION1 = (Table.RotationX or 0)
359
	local ROTATION2 = (Table.RotationY or 0)
360
	local ROTATION3 = (Table.RotationZ or 0)
361
	local MATERIAL = (Table.Material or "Neon")
362
	local COLOR = (Table.Color or C3(1,1,1))
363
	local TIME = (Table.Time or 45)
364
	local SOUNDID = (Table.SoundID or nil)
365
	local SOUNDPITCH = (Table.SoundPitch or nil)
366
	local SOUNDVOLUME = (Table.SoundVolume or nil)
367
	local USEBOOMERANGMATH = (Table.UseBoomerangMath or false)
368
	local BOOMERANG = (Table.Boomerang or 0)
369
	local SIZEBOOMERANG = (Table.SizeBoomerang or 0)
370
	coroutine.resume(coroutine.create(function()
371
		local PLAYSSOUND = false
372
		local SOUND = nil
373
		local EFFECT = CreatePart(3, Effects, MATERIAL, 0, TRANSPARENCY, BRICKC("Pearl"), "Effect", VT(1,1,1), true)
374
		if SOUNDID ~= nil and SOUNDPITCH ~= nil and SOUNDVOLUME ~= nil then
375
			PLAYSSOUND = true
376
			SOUND = CreateSound(SOUNDID, EFFECT, SOUNDVOLUME, SOUNDPITCH, false)
377
		end
378
		EFFECT.Color = COLOR
379
		local MSH = nil
380
		if TYPE == "Sphere" then
381
			MSH = CreateMesh("SpecialMesh", EFFECT, "Sphere", "", "", SIZE, VT(0,0,0))
382
		elseif TYPE == "Block" or TYPE == "Box" then
383
			MSH = IT("BlockMesh",EFFECT)
384
			MSH.Scale = SIZE
385
		elseif TYPE == "Wave" then
386
			MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
387
		elseif TYPE == "Ring" then
388
			MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "559831844", "", VT(SIZE.X,SIZE.X,0.1), VT(0,0,0))
389
		elseif TYPE == "Slash" then
390
			MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662586858", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
391
		elseif TYPE == "Round Slash" then
392
			MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "662585058", "", VT(SIZE.X/10,0,SIZE.X/10), VT(0,0,0))
393
		elseif TYPE == "Swirl" then
394
			MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "168892432", "", SIZE, VT(0,0,0))
395
		elseif TYPE == "Skull" then
396
			MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "4770583", "", SIZE, VT(0,0,0))
397
		elseif TYPE == "Crystal" then
398
			MSH = CreateMesh("SpecialMesh", EFFECT, "FileMesh", "9756362", "", SIZE, VT(0,0,0))
399
		end
400
		if MSH ~= nil then
401
			local BOOMR1 = 1+BOOMERANG/50
402
			local BOOMR2 = 1+SIZEBOOMERANG/50
403
			local MOVESPEED = nil
404
			if MOVEDIRECTION ~= nil then
405
				if USEBOOMERANGMATH == true then
406
					MOVESPEED = ((CFRAME.p - MOVEDIRECTION).Magnitude/TIME)*BOOMR1
407
				else
408
					MOVESPEED = ((CFRAME.p - MOVEDIRECTION).Magnitude/TIME)
409
				end
410
			end
411
			local GROWTH = nil
412
			if USEBOOMERANGMATH == true then
413
				GROWTH = (SIZE - ENDSIZE)*(BOOMR2+1)
414
			else
415
				GROWTH = (SIZE - ENDSIZE)
416
			end
417
			local TRANS = TRANSPARENCY - ENDTRANSPARENCY
418
			if TYPE == "Block" then
419
				EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
420
			else
421
				EFFECT.CFrame = CFRAME
422
			end
423
			if USEBOOMERANGMATH == true then
424
				for LOOP = 1, TIME+1 do
425
					Swait()
426
					MSH.Scale = MSH.Scale - (VT((GROWTH.X)*((1 - (LOOP/TIME)*BOOMR2)),(GROWTH.Y)*((1 - (LOOP/TIME)*BOOMR2)),(GROWTH.Z)*((1 - (LOOP/TIME)*BOOMR2)))*BOOMR2)/TIME
427
					if TYPE == "Wave" then
428
						MSH.Offset = VT(0,0,-MSH.Scale.Z/8)
429
					end
430
					EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
431
					if TYPE == "Block" then
432
						EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
433
					else
434
						EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
435
					end
436
					if MOVEDIRECTION ~= nil then
437
						local ORI = EFFECT.Orientation
438
						EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-(MOVESPEED)*((1 - (LOOP/TIME)*BOOMR1)))
439
						EFFECT.CFrame = CF(EFFECT.Position)*ANGLES(RAD(ORI.X),RAD(ORI.Y),RAD(ORI.Z))
440
					end
441
				end
442
			else
443
				for LOOP = 1, TIME+1 do
444
					Swait()
445
					MSH.Scale = MSH.Scale - GROWTH/TIME
446
					if TYPE == "Wave" then
447
						MSH.Offset = VT(0,0,-MSH.Scale.Z/8)
448
					end
449
					EFFECT.Transparency = EFFECT.Transparency - TRANS/TIME
450
					if TYPE == "Block" then
451
						EFFECT.CFrame = CFRAME*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
452
					else
453
						EFFECT.CFrame = EFFECT.CFrame*ANGLES(RAD(ROTATION1),RAD(ROTATION2),RAD(ROTATION3))
454
					end
455
					if MOVEDIRECTION ~= nil then
456
						local ORI = EFFECT.Orientation
457
						EFFECT.CFrame = CF(EFFECT.Position,MOVEDIRECTION)*CF(0,0,-MOVESPEED)
458
						EFFECT.CFrame = CF(EFFECT.Position)*ANGLES(RAD(ORI.X),RAD(ORI.Y),RAD(ORI.Z))
459
					end
460
				end
461
			end
462
			EFFECT.Transparency = 1
463
			if PLAYSSOUND == false then
464
				EFFECT:remove()
465
			else
466
				repeat Swait() until EFFECT:FindFirstChildOfClass("Sound") == nil
467
				EFFECT:remove()
468
			end
469
		else
470
			if PLAYSSOUND == false then
471
				EFFECT:remove()
472
			else
473
				repeat Swait() until EFFECT:FindFirstChildOfClass("Sound") == nil
474
				EFFECT:remove()
475
			end
476
		end
477
	end))
478
end
479
480
function MakeForm(PART,TYPE)
481
	if TYPE == "Cyl" then
482
		local MSH = IT("CylinderMesh",PART)
483
	elseif TYPE == "Ball" then
484
		local MSH = IT("SpecialMesh",PART)
485
		MSH.MeshType = "Sphere"
486
	elseif TYPE == "Wedge" then
487
		local MSH = IT("SpecialMesh",PART)
488
		MSH.MeshType = "Wedge"
489
	end
490
end
491
492
Debris = game:GetService("Debris")
493
494
function CastProperRay(StartPos, EndPos, Distance, Ignore)
495
	local DIRECTION = CF(StartPos,EndPos).lookVector
496
	local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore})
497
	return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, DIRECTION * Distance), Ignore)
498
end
499
500
local Particle = IT("ParticleEmitter",nil)
501
Particle.Enabled = false
502
Particle.LightEmission = 0.8
503
Particle.Rate = 150
504
Particle.ZOffset = 1
505
Particle.Rotation = NumberRange.new(-180, 180)
506
507
--ParticleEmitter({Speed = 2, RotSpeed = NumberRange.new(-5, 5), Drag = 0, Size1 = 1, Size2 = 0, Lifetime1 = 1, Lifetime2 = 0, Parent = Torso, Emit = 10, Offset = 360, Enabled = false, Color1 = C3(1,1,1), Color2 = C3(1,1,1), Texture = ""})
508
function ParticleEmitter(Table)
509
	local PRTCL = Particle:Clone()
510
	local Color1 = Table.Color1 or C3(1,1,1)
511
	local Color2 = Table.Color2 or C3(1,1,1)
512
	local Speed = Table.Speed or 5
513
	local Drag = Table.Drag or 0
514
	local Size1 = Table.Size1 or 1
515
	local Size2 = Table.Size2 or 5
516
	local Lifetime1 = Table.Lifetime1 or 1
517
	local Lifetime2 = Table.Lifetime2 or 1.5
518
	local Parent = Table.Parent or Torso
519
	local Emit = Table.Emit or 100
520
	local Offset = Table.Offset or 360
521
	local Acel = Table.Acel or VT(0,0,0)
522
	local Enabled = Table.Enabled or false
523
	local Texture = Table.Texture or "281983280"
524
	local RotS = Table.RotSpeed or NumberRange.new(-15, 15)
525
	local Trans1 = Table.Transparency1 or 0
526
	local Trans2 = Table.Transparency2 or 0
527
	PRTCL.Parent = Parent
528
	PRTCL.RotSpeed = RotS
529
	PRTCL.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,Trans1),NumberSequenceKeypoint.new(1,Trans2)})
530
	PRTCL.Texture = "http://www.roblox.com/asset/?id="..Texture
531
	PRTCL.Color = ColorSequence.new(Color1,Color2)
532
	PRTCL.Size = NumberSequence.new(Size1,Size2)
533
	PRTCL.Lifetime = NumberRange.new(Lifetime1,Lifetime2)
534
	PRTCL.Speed = NumberRange.new(Speed)
535
	PRTCL.VelocitySpread = Offset
536
	PRTCL.Drag = Drag
537
	PRTCL.Acceleration = Acel
538
	if Enabled == false then
539
		PRTCL:Emit(Emit)
540
		Debris:AddItem(PRTCL,Lifetime2)
541
	else
542
		PRTCL.Enabled = true
543
	end
544
	return PRTCL
545
end
546
547
function AttackGyro()
548
	local GYRO = IT("BodyGyro",RootPart)
549
	GYRO.D = 15
550
	GYRO.P = 200000
551
	GYRO.MaxTorque = VT(0,4000000,0)
552
	GYRO.CFrame = CF(RootPart.Position,Mouse.Hit.p)
553
	coroutine.resume(coroutine.create(function()
554
		repeat
555
			Swait()
556
			GYRO.CFrame = CF(RootPart.Position,Mouse.Hit.p)
557
		until ATTACK == false
558
		GYRO:Remove()
559
	end))
560
end
561
562
--//=================================\\
563
--||	    GUIS AND MISC
564
--\\=================================//
565
566
local CAMTYPE = Cam.CameraType
567
Cam.CameraType = Enum.CameraType.Scriptable
568
569
local ATTACKS = {2035463713,2035463980,2035464212,2035464495}
570
571
local BMUSIC = IT("Sound",RootPart)
572
local VOLUME = 4.5
573
local PITCH = 1.15
574
local SONGID = 904882921
575
local INTROD = false
576
local SUN = CreatePart(3, nil, "Neon", 0, 0, BRICKC("New Yeller"), "Sun", VT(17,17,17), true)
577
MakeForm(SUN,"Ball")
578
local SUNFLOAT = true
579
local CUSTOMCAM = true
580
581
--//=================================\\
582
--||			DAMAGING
583
--\\=================================//
584
585
function ApplyAoE(POSITION,RANGE,FLING,KILLME)
586
	for index, CHILD in pairs(workspace:GetDescendants()) do
587
		if CHILD.ClassName == "Model" and CHILD ~= Character then
588
			local HUM = CHILD:FindFirstChildOfClass("Humanoid")
589
			if HUM then
590
				local TORSO = CHILD:FindFirstChild("Torso") or CHILD:FindFirstChild("UpperTorso")
591
				if TORSO and HUM.Health > 0 then
592
					if (TORSO.Position - POSITION).Magnitude <= RANGE then		
593
						CHILD:BreakJoints()
594
						local HED = CHILD:FindFirstChild("Head")
595
						if HED and MRANDOM(1,15) == 1 then
596
							CreateSound(527749592, HED, 4, MRANDOM(9,11)/10, false)
597
						end
598
						if FLING > 0 then
599
							for _, c in pairs(CHILD:GetChildren()) do
600
								if c:IsA("BasePart") then
601
									local bv = Instance.new("BodyVelocity") 
602
									bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
603
									bv.velocity = CF(POSITION,TORSO.Position).lookVector*FLING
604
									bv.Parent = c
605
									Debris:AddItem(bv,0.05)
606
								end
607
							end
608
						end
609
					end
610
				end
611
			end
612
		end
613
	end
614
	if KILLME == true then
615
		Character:BreakJoints()
616
		for _, c in pairs(Character:GetChildren()) do
617
			if c:IsA("BasePart") then
618
				local bv = Instance.new("BodyVelocity") 
619
				bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
620
				bv.velocity = CF(POSITION,c.Position).lookVector*FLING
621
				bv.Parent = c
622
				Debris:AddItem(bv,0.05)
623
			end
624
		end
625
	end
626
end
627
628
--//=================================\\
629
--||	ATTACK FUNCTIONS AND STUFF
630
--\\=================================//
631
632
function Intro()
633
	ATTACK = true
634
	Rooted = true
635
	Humanoid.WalkSpeed = 0
636
	Disable_Jump = true
637
	local INTROSOUND = CreateSound(862484466, Effects, 6, 1, false)
638
	coroutine.resume(coroutine.create(function()
639
		repeat
640
			Swait()
641
			if CUSTOMANGLES == true then
642
				Cam.CFrame = Clerp(Cam.CFrame, Head.CFrame * CF(0,0,-4) * ANGLES(RAD(0), RAD(180), RAD(0)), 0.2)
643
			end
644
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
645
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
646
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(0), RAD(0), RAD(5)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
647
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(0), RAD(0), RAD(-5)) * LEFTSHOULDERC0, 1 / Animation_Speed)
648
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(60), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed)
649
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-60), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed)
650
		until INTROSOUND.TimePosition >= 2.15
651
		SUN.Parent = Effects
652
		local CORE = IT("Attachment",SUN)
653
		SUN.Color = C3(1,85/255,0)
654
		SUN.CFrame = RootPart.CFrame*CF(0,-14,11)
655
		local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871})
656
		P.LockedToPart = true
657
		P.Rate = 12
658
		local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871})
659
		P.Rate = 12
660
		repeat
661
			Swait()
662
			SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,14,11),0.04)
663
			local HITFLOOR,SUNPOS = Raycast(SUN.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 23, Character)
664
			if HITFLOOR then
665
				local DISTANCE = (SUNPOS - SUN.Position).Magnitude
666
				local SIZE = (23 - DISTANCE)*2
667
			end
668
			if CUSTOMANGLES == true then
669
				Cam.CFrame = Clerp(Cam.CFrame, Head.CFrame * CF(0,5,-15) * ANGLES(RAD(5), RAD(180), RAD(0)), 0.2)
670
			end
671
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
672
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-35 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
673
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
674
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed)
675
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
676
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
677
		until ATTACK == false
678
		CUSTOMCAM = false
679
		for i = 1, #ATTACKS do
680
			local SKILLFRAME = CreateFrame(WEAPONGUI, 1, 2, UD2(0.65, 0, 0.95-(0.17*i), 0), UD2(0.26, 0, 0.17, 0), C3(0,0,0), C3(0, 0, 0), "Skill Frame")
681
			local IMAGE = IT("ImageLabel",SKILLFRAME)
682
			IMAGE.Size = UD2(1,0,1,0)
683
			IMAGE.Image = "rbxassetid://"..ATTACKS[i]
684
			IMAGE.BackgroundTransparency = 1
685
			IMAGE.ImageTransparency = 1
686
			for i = 1, 10 do
687
				Swait()
688
				IMAGE.ImageTransparency = IMAGE.ImageTransparency - 1/10
689
			end
690
		end
691
	end))
692
	repeat
693
		Swait()
694
		INTROSOUND.Parent = Effects
695
	until INTROSOUND.Playing == false
696
	INTROSOUND:Destroy()
697
	ATTACK = false
698
	Rooted = false
699
end
700
function DeadlyLaser()
701
	CreateSound(811841430, SUN, 8, MRANDOM(7,13)/10, false)
702
	local HIT,POS = CastProperRay(SUN.Position,Mouse.Hit.p,1000,Character)
703
	local BEAM = CreatePart(3, Effects, "Neon", 0, 0, BRICKC("Gold"), "Beam", VT(0,0,0), true)
704
	BEAM.Color = SUN.Color
705
	MakeForm(BEAM,"Cyl")
706
	local DIST = (SUN.Position - POS).Magnitude
707
	BEAM.Size = VT(0,DIST,0)
708
	BEAM.CFrame = CF(SUN.Position,POS)*CF(0,0,-DIST/2) * ANGLES(RAD(90), RAD(0), RAD(0))
709
	if HIT ~= nil then
710
		if HIT.Parent.ClassName == "Model" then
711
			if HIT.Parent:FindFirstChildOfClass("Humanoid") then
712
				if HIT.Parent:FindFirstChildOfClass("Humanoid").Health > 0 then
713
					local HED = HIT.Parent:FindFirstChild("Head")
714
					if HED and MRANDOM(1,15) == 1 then
715
						CreateSound(527749592, HED, 4, MRANDOM(9,11)/10, false)
716
					end
717
					HIT.Parent:BreakJoints()
718
				end
719
			end
720
		end
721
	end
722
	for i = 1, 15 do
723
		Swait()
724
		BEAM.Size = BEAM.Size + VT(0.25,0,0.25)
725
		BEAM.Transparency = BEAM.Transparency + 1/15
726
	end
727
	BEAM:remove()
728
end
729
function SolarFlares()
730
	ATTACK = true
731
	Rooted = true
732
	SUNFLOAT = false
733
	CUSTOMCAM = true
734
	for i=0, 1, 0.1 / Animation_Speed do
735
		Swait()
736
		if CUSTOMANGLES == true then
737
			Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-45), RAD(0), RAD(0))*CF(0,0,65), 0.1)
738
		end
739
		SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,18 + 4 * SIN(SINE / 12),0),0.035)
740
		RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
741
		Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-35 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
742
		RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
743
		LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed)
744
		RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
745
		LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
746
	end
747
	local CFRAME = RootPart.CFrame * ANGLES(RAD(-90), RAD(0), RAD(0))*CF(0,0,125)
748
	coroutine.resume(coroutine.create(function()
749
		repeat
750
			Swait()
751
			if CUSTOMANGLES == true then
752
				Cam.CFrame = Clerp(Cam.CFrame, CFRAME, 0.1)
753
			end
754
			SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,18 + 4 * SIN(SINE / 12),0),0.035)
755
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
756
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
757
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(90), RAD(0), RAD(-15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
758
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(90), RAD(0), RAD(15)) * LEFTSHOULDERC0, 1 / Animation_Speed)
759
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
760
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
761
		until ATTACK == false
762
	end))
763
	AttackGyro()
764
	wait(0.2)
765
	for i = 1, 15 do
766
		Swait()
767
		coroutine.resume(coroutine.create(function()
768
			local SPEED = MRANDOM(5,32)/10
769
			local FLARE = CreatePart(3, Effects, "Neon", 0, 0, SUN.BrickColor, "Sun", VT(5,5,5), true)
770
			FLARE.Color = C3(1,85/255,0)
771
			MakeForm(FLARE,"Ball")
772
			CreateSound(463598785, FLARE, 1.2, MRANDOM(7,13)/8, false)
773
			FLARE.CFrame = CF(SUN.Position,Mouse.Hit.p) * ANGLES(RAD(MRANDOM(-5,5)*2), RAD(MRANDOM(-5,5)*2), RAD(0))
774
			local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871})
775
			for i = 1, 500 do
776
				Swait()
777
				P.Enabled = true
778
				local HIT,HITPOS = Raycast(FLARE.Position, FLARE.CFrame.lookVector, FLARE.Size.Z/2, Character)
779
				if HIT then
780
					break
781
				else
782
					FLARE.CFrame = FLARE.CFrame*CF(0,0,-SPEED)
783
					if MRANDOM(1,3) == 1 then
784
						WACKYEFFECT({Time = 25, EffectType = "Round Slash", Size = VT(0,0,0), Size2 = VT(0.025,0,0.025), Transparency = 0.85, Transparency2 = 1, CFrame = FLARE.CFrame*CF(0,0,-FLARE.Size.X/1.5) * ANGLES(RAD(90), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 0.1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 45})
785
					end
786
				end
787
			end
788
			CreateSound(165970126, FLARE, 0.8, MRANDOM(7,13)/8, false)
789
			CreateSound(174580476, FLARE, 1.6, MRANDOM(7,13)/10, false)
790
			P.Enabled = false
791
			ApplyAoE(FLARE.Position,14,125)
792
			Debris:AddItem(FLARE,5)
793
			FLARE.Transparency = 1
794
			WACKYEFFECT({EffectType = "Sphere", Size = FLARE.Size, Size2 = VT(25,25,25), Transparency = 0, Transparency2 = 1, CFrame = CF(FLARE.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = FLARE.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
795
			ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871})
796
		end))
797
	end
798
	wait(0.1)
799
	CUSTOMCAM = false
800
	SUNFLOAT = true
801
	ATTACK = false
802
	Rooted = false
803
end
804
function SolarSmash()
805
	local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
806
	if HITFLOOR then
807
		ATTACK = true
808
		Rooted = false
809
		CUSTOMCAM = true
810
		SUNFLOAT = false
811
		for i=0, 0.2, 0.1 / Animation_Speed do
812
			Swait()
813
			if CUSTOMANGLES == true then
814
				Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-45), RAD(0), RAD(0))*CF(0,0,65), 0.1)
815
			end
816
			SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,18 + 4 * SIN(SINE / 12),6),0.035)
817
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
818
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-35 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
819
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
820
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(150), RAD(0), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed)
821
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
822
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
823
		end
824
		coroutine.resume(coroutine.create(function()
825
			repeat
826
				Swait()
827
				if CUSTOMANGLES == true then
828
					Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-75), RAD(0), RAD(0))*CF(0,6,65), 0.1)
829
				end
830
				RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
831
				Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
832
				RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(35), RAD(0), RAD(-15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
833
				LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.45 + 0.05 * SIN(SINE / 12), -0.45) * ANGLES(RAD(35), RAD(0), RAD(15)) * LEFTSHOULDERC0, 1 / Animation_Speed)
834
				RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
835
				LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
836
			until ATTACK == false
837
		end))
838
		local CFRAME = RootPart.CFrame*CF(0,-2,-17)
839
		for i = 1, 10 do
840
			Swait()
841
			SUN.CFrame = Clerp(SUN.CFrame,CFRAME, 0.25)
842
		end
843
		ApplyAoE(SUN.Position,65,225)
844
		ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871})
845
		for i = 1, 8 do
846
			WACKYEFFECT({Time = 30+(i*25), EffectType = "Wave", Size = VT(15,0,15), Size2 = VT(120,0,120), Transparency = 0.6, Transparency2 = 1, CFrame = CF(SUN.Position-VT(0,5,0)) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 0.1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 22})
847
		end
848
		for i = 1, 5 do
849
			WACKYEFFECT({Time = 50+(i*25), EffectType = "Round Slash", Size = VT(0,0,0), Size2 = VT(1.5,0,1.5), Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position-VT(0,5,0)) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 0.1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 3})
850
		end
851
		WACKYEFFECT({Time = 75, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*6, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 168513088, SoundPitch = 1, SoundVolume = 5, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 3})
852
		WACKYEFFECT({Time = 65, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*5.5, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 201858144, SoundPitch = 1, SoundVolume = 3, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
853
		local bv = Instance.new("BodyVelocity") 
854
		bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
855
		bv.velocity = CF(CFRAME.p-VT(0,12,0),RootPart.Position).lookVector*125
856
		bv.Parent = RootPart
857
		Debris:AddItem(bv,0.02)
858
		CUSTOMCAM = false
859
		for i = 1, 5 do
860
			Swait()
861
			SUN.CFrame = Clerp(SUN.CFrame,CFRAME, 0.1)
862
		end
863
		SUNFLOAT = true
864
		ATTACK = false
865
		Rooted = false
866
	end
867
end
868
function SolarEruption()
869
	ATTACK = true
870
	Rooted = true
871
	CUSTOMCAM = true
872
	local ANIMA = "HoldUp"
873
	coroutine.resume(coroutine.create(function()
874
		repeat
875
			Swait()
876
			if ANIMA == "HoldUp" then
877
				if CUSTOMANGLES == true then
878
					Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-45), RAD(0), RAD(0))*CF(0,0,65), 0.1)
879
				end
880
				SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,28 + 4 * SIN(SINE / 12),6),0.035)
881
				RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
882
				Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
883
				RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1, 0.85 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(160 + 3 * SIN(SINE / 12)), RAD(5), RAD(-15 + 3 * COS(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed)
884
				LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed)
885
				RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(70), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed)
886
				LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-70), RAD(0)) * ANGLES(RAD(-11), RAD(0), RAD(0)), 1 / Animation_Speed)
887
			elseif ANIMA == "Fire" then
888
				if CUSTOMANGLES == true then
889
					Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * CF(0,135,0) * ANGLES(RAD(-90), RAD(0), RAD(0)), 0.2)
890
				end
891
				SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,35,0),0.2)
892
				RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
893
				Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-25 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
894
				RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.25, 0.65 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(170), RAD(5), RAD(15)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
895
				LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.25, 0.65 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(170), RAD(-5), RAD(-15)) * LEFTSHOULDERC0, 1 / Animation_Speed)
896
				RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(-25), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
897
				LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(-25), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
898
			end
899
		until ATTACK == false
900
	end))
901
	CreateSound(201858045, SUN, 1.8, MRANDOM(7,13)/10, false)
902
	CreateSound(278641993, SUN, 3, MRANDOM(7,13)/10, false)
903
	CreateSound(278641993, SUN, 2.5, MRANDOM(7,13)/10, false)
904
	for i = 1, 150 do
905
		Swait()
906
		WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(85,0,85), Size2 = VT(0,0,0), Transparency = 1, Transparency2 = 0.8, CFrame = CF(SUN.Position)*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
907
		WACKYEFFECT({Time = 15, EffectType = "Sphere", Size = VT(45,45,45), Size2 = VT(0,0,0), Transparency = 0.95, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
908
	end
909
	wait(0.1)
910
	UNANCHOR = false
911
	ANIMA = "Fire"
912
	wait(0.4)
913
	ApplyAoE(SUN.Position,25,75)
914
	WACKYEFFECT({Time = 45, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*4, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = 1, SoundVolume = 5, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 3})
915
	WACKYEFFECT({Time = 35, EffectType = "Sphere", Size = SUN.Size, Size2 = SUN.Size*3.5, Transparency = 0, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 401056199, SoundPitch = 1, SoundVolume = 7, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
916
	coroutine.resume(coroutine.create(function()
917
		for i = 1, 32 do
918
			Swait()
919
			coroutine.resume(coroutine.create(function()
920
				local FLARE = CreatePart(3, Effects, "Neon", 0, 0, SUN.BrickColor, "Sun", VT(5,5,5), false)
921
				FLARE.CanCollide = true
922
				FLARE.Color = C3(1,85/255,0)
923
				MakeForm(FLARE,"Ball")
924
				Debris:AddItem(FLARE,10)
925
				CreateSound(463598785, FLARE, 1.2, MRANDOM(7,13)/8, false)
926
				local P = ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871})
927
				FLARE.CFrame = CF(SUN.Position)*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)))
928
				FLARE.Velocity = CF(SUN.Position,CF(SUN.Position)*ANGLES(RAD(0),RAD(MRANDOM(0,360)),RAD(0))*CF(MRANDOM(-60,60),25,MRANDOM(-60,60)).p).lookVector*MRANDOM(25,250)
929
				TOUCH = FLARE.Touched:Connect(function(TOC)
930
					if TOC.Parent ~= Character and TOC.Parent.Parent ~= Character then
931
						FLARE.Anchored = true
932
						FLARE:ClearAllChildren()
933
						CreateSound(165970126, FLARE, 0.8, MRANDOM(7,13)/8, false)
934
						CreateSound(174580476, FLARE, 1.6, MRANDOM(7,13)/10, false)
935
						FLARE.CanCollide = false
936
						ApplyAoE(FLARE.Position,14,125)
937
						FLARE.Transparency = 1
938
						WACKYEFFECT({EffectType = "Sphere", Size = FLARE.Size, Size2 = VT(25,25,25), Transparency = 0, Transparency2 = 1, CFrame = CF(FLARE.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = FLARE.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
939
						ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 1, Acel = VT(0,0,0), RotSpeed = NumberRange.new(-5, 5), Drag = 0.1, Size1 = 3, Size2 = 5, Lifetime1 = 0.1, Lifetime2 = 0.2, Parent = CORE, Emit = 10, Offset = 180, Enabled = true, Color1 = C3(1,85/255,0), Color2 = C3(1,85/255,0), Texture = 296874871})
940
						TOUCH:Disconnect()
941
					end
942
				end)
943
			end))
944
		end
945
	end))
946
	wait(1.5)
947
	UNANCHOR = true
948
	CUSTOMCAM = false
949
	ATTACK = false
950
	Rooted = false
951
end
952
function Nebula()
953
	ATTACK = true
954
	Rooted = false
955
	CUSTOMCAM = true
956
	local DEAD = false
957
	coroutine.resume(coroutine.create(function()
958
		while true do
959
			Swait()
960
			if DEAD == false then
961
				if CUSTOMANGLES == true then
962
					Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * CF(0,435,0) * ANGLES(RAD(-90), RAD(0), RAD(0)), 0.01)
963
				end
964
				SUN.CFrame = Clerp(SUN.CFrame,RootPart.CFrame*CF(0,35,0),0.2)
965
			end
966
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 1 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(0)), 1 / Animation_Speed)
967
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(0)), 1 / Animation_Speed)
968
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1, 0.85 + 0.05 * SIN(SINE / 12), 0) * ANGLES(RAD(160), RAD(5), RAD(-15)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
969
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed)
970
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
971
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
972
		end
973
	end))
974
	wait(1)
975
	CreateSound(201858045, SUN, 1.8, MRANDOM(7,13)/10, false)
976
	CreateSound(278641993, SUN, 3, MRANDOM(7,13)/10, false)
977
	CreateSound(278641993, SUN, 2.5, MRANDOM(7,13)/10, false)
978
	for i = 1, 250 do
979
		Swait()
980
		WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(2,0,2), Size2 = VT(32,2.5,32), Transparency = 0.75, Transparency2 = 1, CFrame = CF(RootPart.CFrame*CF(0,-4,0).p) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = C3(1,1,1), SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 22})
981
		WACKYEFFECT({Time = 15, EffectType = "Wave", Size = VT(85,0,85), Size2 = VT(0,0,0), Transparency = 1, Transparency2 = 0.8, CFrame = CF(SUN.Position)*ANGLES(RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360)),RAD(MRANDOM(0,360))), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
982
		WACKYEFFECT({Time = 15, EffectType = "Sphere", Size = VT(45,45,45), Size2 = VT(0,0,0), Transparency = 0.95, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = nil, SoundPitch = nil, SoundVolume = nil, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
983
	end
984
	wait(1)
985
	for i = 1, 3 do
986
		wait(0.65)
987
		WACKYEFFECT({Time = 35, EffectType = "Sphere", Size = SUN.Size, Size2 = VT(250,250,250), Transparency = 0.5, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = SUN.Color, SoundID = 852135845, SoundPitch = 1-(i/10), SoundVolume = 5, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
988
	end
989
	wait(0.65)
990
	ApplyAoE(SUN.Position,9999999999999999,125,true)
991
	SUN:ClearAllChildren()
992
	SUN.Transparency = 1
993
	CreateSound(385545047, Effects, 2.5, 1.4, false)
994
	CreateSound(385545047, Effects, 2.5, 1, false)
995
	CreateSound(435742675, Effects, 2.5, 1.5, false)
996
	CreateSound(231917744, Effects, 2.5, 1.5, false)
997
	CreateSound(401056199, Effects, 2.5, 1, false)
998
	ParticleEmitter({Transparency1 = 1, Transparency2 = 1, Speed = 25, Acel = VT(0,0,0), RotSpeed = NumberRange.new(5, 5), Drag = -1, Size1 = 5, Size2 = 6, Lifetime1 = 0.1, Lifetime2 = 1, Parent = SUN, Emit = 20, Offset = 180, Enabled = false, Color1 = C3(1,85/255,0), Color2 = BRICKC"Royal purple".Color, Texture = 296874871})
999
	for i = 1, 3 do
1000
		WACKYEFFECT({Time = 175, EffectType = "Sphere", Size = SUN.Size, Size2 = VT(250,250,250)+(VT(i,i,i)*180), Transparency = 0.5, Transparency2 = 1, CFrame = CF(SUN.Position), MoveToPos = nil, RotationX = 0, RotationY = 0, RotationZ = 0, Material = "Neon", Color = BRICKC"Royal purple".Color, SoundID = nil, SoundPitch = 1-(i/10), SoundVolume = 5, UseBoomerangMath = false, Boomerang = 0, SizeBoomerang = 0})
1001
	end
1002
	for i = 1, 15 do
1003
		WACKYEFFECT({Time = 100+(i*35), EffectType = "Wave", Size = VT(15,0,15), Size2 = VT(120,5,120)+(VT(i,0,i)*70), Transparency = 0.6, Transparency2 = 1, CFrame = CF(SUN.Position) * ANGLES(RAD(0), RAD(MRANDOM(0,360)), RAD(0)) * ANGLES(RAD(MRANDOM(-15,15)), RAD(MRANDOM(0,360)), RAD(0)), MoveToPos = nil, RotationX = 1, RotationY = 0, RotationZ = 0, Material = "Neon", Color = BRICKC"Pink".Color, SoundID = nil, SoundPitch = MRANDOM(9,11)/10, SoundVolume = MRANDOM(9,11)/2, UseBoomerangMath = true, Boomerang = 0, SizeBoomerang = 22})
1004
	end
1005
	DEAD = true
1006
	Cam.CameraType = CAMTYPE
1007
	Cam.CameraSubject = Humanoid
1008
	INTROD = false
1009
end
1010
function Taunt()
1011
	ATTACK = true
1012
	Rooted = true
1013
	CUSTOMCAM = true
1014
	CreateSound(160212768, Head, 10, 1, false)
1015
	for i=0, 3, 0.1 / Animation_Speed do
1016
		Swait()
1017
		if CUSTOMANGLES == true then
1018
			Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * CF(7,1.5,6) * ANGLES(RAD(-4), RAD(15), RAD(0)), 0.2)
1019
		end
1020
		RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-35)), 1 / Animation_Speed)
1021
		Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(15 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(35)), 1 / Animation_Speed)
1022
		RightShoulder.C0 = Clerp(RightShoulder.C0, CF(0.75, 0.5 + 0.05 * SIN(SINE / 12), -0.7) * ANGLES(RAD(0), RAD(0), RAD(-95)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1023
		LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.3, 0.5 + 0.05 * SIN(SINE / 12), -0.3) * ANGLES(RAD(90), RAD(0), RAD(-35)) * LEFTSHOULDERC0, 1 / Animation_Speed)
1024
		RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(95), RAD(0)) * ANGLES(RAD(-15), RAD(0), RAD(0)), 1 / Animation_Speed)
1025
		LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-55), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
1026
	end
1027
	CUSTOMCAM = false
1028
	ATTACK = false
1029
	Rooted = false
1030
end
1031
1032
--//=================================\\
1033
--||	  ASSIGN THINGS TO KEYS
1034
--\\=================================//
1035
1036
function MouseDown(Mouse)
1037
	if ATTACK == false then
1038
		DeadlyLaser()
1039
	end
1040
end
1041
1042
function MouseUp(Mouse)
1043
HOLD = false
1044
end
1045
1046
function KeyDown(Key)
1047
	KEYHOLD = true
1048
	if Key == "z" and ATTACK == false then
1049
		SolarFlares()
1050
	end
1051
1052
	if Key == "c" and ATTACK == false then
1053
		SolarSmash()
1054
	end
1055
1056
	if Key == "v" and ATTACK == false then
1057
		SolarEruption()
1058
	end
1059
1060
	if Key == "x" and ATTACK == false then
1061
		Nebula()
1062
	end
1063
1064
	if Key == "t" and ATTACK == false then
1065
		Taunt()
1066
	end
1067
1068
	if Key == "q" and ATTACK == false then
1069
		if CUSTOMANGLES == true then
1070
			CUSTOMANGLES = false
1071
			Cam.CameraSubject = Humanoid
1072
		else
1073
			CUSTOMANGLES = true
1074
		end
1075
	end
1076
end
1077
1078
function KeyUp(Key)
1079
	KEYHOLD = false
1080
end
1081
1082
	Mouse.Button1Down:connect(function(NEWKEY)
1083
		MouseDown(NEWKEY)
1084
	end)
1085
	Mouse.Button1Up:connect(function(NEWKEY)
1086
		MouseUp(NEWKEY)
1087
	end)
1088
	Mouse.KeyDown:connect(function(NEWKEY)
1089
		KeyDown(NEWKEY)
1090
	end)
1091
	Mouse.KeyUp:connect(function(NEWKEY)
1092
		KeyUp(NEWKEY)
1093
	end)
1094
1095
--//=================================\\
1096
--\\=================================//
1097
1098
function unanchor()
1099
	for _, c in pairs(Character:GetChildren()) do
1100
		if c:IsA("BasePart") and c ~= RootPart then
1101
			c.Anchored = false
1102
		end
1103
	end
1104
	if UNANCHOR == true then
1105
		RootPart.Anchored = false
1106
	else
1107
		RootPart.Anchored = true
1108
	end
1109
end
1110
1111
--//=================================\\
1112
--||	WRAP THE WHOLE SCRIPT UP
1113
--\\=================================//
1114
1115
Humanoid.Changed:connect(function(Jump)
1116
	if Jump == "Jump" and (Disable_Jump == true) then
1117
		Humanoid.Jump = false
1118
	end
1119
end)
1120
1121
while true do
1122
	Swait()
1123
	script.Parent = WEAPONGUI
1124
	ANIMATE.Parent = nil
1125
	for _,v in next, Humanoid:GetPlayingAnimationTracks() do
1126
	    v:Stop();
1127
	end
1128
	SINE = SINE + CHANGE
1129
	local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude
1130
	local TORSOVERTICALVELOCITY = RootPart.Velocity.y
1131
	local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
1132
	local WALKSPEEDVALUE = 8 / (Humanoid.WalkSpeed / 16)
1133
	if ANIM == "Walk" and TORSOVELOCITY > 1 then
1134
		RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0.1 * COS(SINE / (WALKSPEEDVALUE/2))) * ANGLES(RAD(0), RAD(0), RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1135
		Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
1136
		RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.25 * SIN(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10+50 * COS(SINE / WALKSPEEDVALUE))), 0.6 / Animation_Speed)
1137
		LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.25 * SIN(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(-10+50 * COS(SINE / WALKSPEEDVALUE))), 0.6 / Animation_Speed)
1138
	elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then
1139
		RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1140
		Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
1141
		RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.7 / Animation_Speed)
1142
		LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.7 / Animation_Speed)
1143
	end
1144
	if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then
1145
		ANIM = "Jump"
1146
		if ATTACK == false then
1147
			RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(-5), RAD(0), RAD(0)), 1 / Animation_Speed)
1148
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(-25), RAD(0), RAD(0)), 1 / Animation_Speed)
1149
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-35), RAD(0), RAD(25 + 10 * COS(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1150
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-35), RAD(0), RAD(-25 - 10 * COS(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
1151
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.4, -0.6) * ANGLES(RAD(1), RAD(90), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed)
1152
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-85), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed)
1153
		end
1154
	elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then
1155
		ANIM = "Fall"
1156
		if ATTACK == false then
1157
			RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(15), RAD(0), RAD(0)), 1 / Animation_Speed)
1158
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0 , 0 + ((1) - 1)) * ANGLES(RAD(15), RAD(0), RAD(0)), 1 / Animation_Speed)
1159
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(35 - 4 * COS(SINE / 6)), RAD(0), RAD(45 + 10 * COS(SINE / 12))) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1160
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(35 - 4 * COS(SINE / 6)), RAD(0), RAD(-45 - 10 * COS(SINE / 12))) * LEFTSHOULDERC0, 1 / Animation_Speed)
1161
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -0.3, -0.7) * ANGLES(RAD(-25 + 5 * SIN(SINE / 12)), RAD(90), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed)
1162
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -0.8, -0.3) * ANGLES(RAD(-10), RAD(-80), RAD(0)) * ANGLES(RAD(-1 * SIN(SINE / 6)), RAD(0), RAD(0)), 1 / Animation_Speed)
1163
		end
1164
	elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then
1165
		ANIM = "Idle"
1166
		if ATTACK == false then
1167
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.03 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(0), RAD(0), RAD(-35)), 1 / Animation_Speed)
1168
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(0 - 2.5 * SIN(SINE / 12)), RAD(0), RAD(35)), 1 / Animation_Speed)
1169
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(0.75, 0.5 + 0.05 * SIN(SINE / 12), -0.7) * ANGLES(RAD(0), RAD(0), RAD(-95)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1170
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed)
1171
			RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(95), RAD(0)) * ANGLES(RAD(-15), RAD(0), RAD(0)), 1 / Animation_Speed)
1172
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), 0) * ANGLES(RAD(0), RAD(-55), RAD(0)) * ANGLES(RAD(-12), RAD(0), RAD(0)), 1 / Animation_Speed)
1173
		end
1174
	elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
1175
		ANIM = "Walk"
1176
		if ATTACK == false then
1177
			RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, -0.05) * ANGLES(RAD(5), RAD(0), RAD(-15-7 * COS(SINE / (WALKSPEEDVALUE)))), 1 / Animation_Speed)
1178
			Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(5 - 1 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(15+7 * COS(SINE / (WALKSPEEDVALUE)))), 1 / Animation_Speed)
1179
			RightShoulder.C0 = Clerp(RightShoulder.C0, CF(0.75, 0.5 + 0.05 * SIN(SINE / 12), -0.7) * ANGLES(RAD(0), RAD(0), RAD(-95)) * ANGLES(RAD(5), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 1 / Animation_Speed)
1180
			LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-0.75, 0.35 + 0.05 * SIN(SINE / 12), -0.6) * ANGLES(RAD(0), RAD(0), RAD(92)) * ANGLES(RAD(0), RAD(0), RAD(0)) * LEFTSHOULDERC0, 1 / Animation_Speed)
1181
			RightHip.C0 = Clerp(RightHip.C0, CF(1 , -1, 0) * ANGLES(RAD(0), RAD(105), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 2 / Animation_Speed)
1182
			LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-75), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 2 / Animation_Speed)
1183
		end
1184
	end
1185
	unanchor()
1186
	if INTROD == true then
1187
		if SUNFLOAT == true then
1188
			SUN.CFrame = Clerp(SUN.CFrame,Torso.CFrame*CF(0,14 + 4 * SIN(SINE / 12),11),0.035)
1189
		end
1190
		local HITFLOOR,SUNPOS = Raycast(SUN.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 23, Character)
1191
		if HITFLOOR then
1192
			local DISTANCE = (SUNPOS - SUN.Position).Magnitude
1193
			local SIZE = (23 - DISTANCE)*2
1194
		end
1195
	end
1196
	Humanoid.MaxHealth = 500
1197
	Humanoid.Health = 500
1198
	if Rooted == false then
1199
		Disable_Jump = false
1200
		Humanoid.WalkSpeed = Speed
1201
	elseif Rooted == true then
1202
		Disable_Jump = true
1203
		Humanoid.WalkSpeed = 0
1204
	end
1205
	BMUSIC.SoundId = "rbxassetid://"..SONGID
1206
	BMUSIC.Looped = true
1207
	BMUSIC.Pitch = PITCH
1208
	BMUSIC.Volume = VOLUME
1209
	BMUSIC.Playing = INTROD
1210
	if BMUSIC.Parent ~= RootPart then
1211
		BMUSIC = IT("Sound",RootPart)
1212
	end
1213
	Humanoid.Name = "THE_SUN_IS_A_DEADLY_LASER"
1214
	if INTROD == false and ATTACK == false then
1215
		Intro()
1216
		INTROD = true
1217
	end
1218
	local VELOC = -RootPart.RotVelocity.Y
1219
	if VELOC < -35 then
1220
		VELOC = -35
1221
	elseif VELOC > 35 then
1222
		VELOC = 35
1223
	end
1224
	if CUSTOMANGLES == true then
1225
		Cam.CameraType = Enum.CameraType.Scriptable
1226
		if CUSTOMCAM == false then
1227
			Cam.CFrame = Clerp(Cam.CFrame, RootPart.CFrame * ANGLES(RAD(-5), RAD(0), RAD(VELOC)) * CF(12,7,25), 0.15)
1228
		end
1229
	else
1230
		Cam.CameraType = CAMTYPE
1231
	end
1232
end
1233
1234
--//=================================\\
1235
--\\=================================//
1236
1237
1238
1239
1240
1241
--//====================================================\\--
1242
--||			  		 END OF SCRIPT
1243
--\\====================================================//--