Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function THE_SUN(owner)-- By CHL/SoftlockedUnderZero
- local Settings={
- NeedsPermission=true;
- };
- print'https://pastebin.com/raw/sKk8Vthq';print'https://pastebin.com/raw/5QSqffmx';
- print'Bossfight Theme="Guardian of The Former Seas"';print'Why? I like the music';
- local function Instance_2(c,p)if not c then return;end;p=p or {};
- local a=Instance.new(c,p.Parent);for b,c in pairs(p)do local _,d=pcall(function()a[b]=c;end);
- if d then print(d);end;end;return a;end;
- local Name_ID={OptInPart=0;THESUN=0;};
- local function Ragdoll_v2(model)local hum=model:FindFirstChildWhichIsA'Humanoid';if not hum then
- return;end;hum.BreakJointsOnDeath=false;
- local LArm,RArm,LLeg,RLeg,torso,head,LUA,LLA,LH,RUA,RLA,RH,LUL,LLL,LF,RUL,RLL,RF,UT,LT=
- model:FindFirstChild'Left Arm',model:FindFirstChild'Right Arm',model:FindFirstChild'Left Leg',
- model:FindFirstChild'Right Leg',model:FindFirstChild'Torso',model:FindFirstChild'Head',model:
- FindFirstChild'LeftUpperArm',model:FindFirstChild'LeftLowerArm',model:FindFirstChild'LeftHand',
- model:FindFirstChild'RightUpperArm',model:FindFirstChild'RightLowerArm',model:FindFirstChild
- 'RightHand',model:FindFirstChild'LeftUpperLeg',model:FindFirstChild'LeftLowerLeg',model:
- FindFirstChild'LeftFoot',model:FindFirstChild'RightUpperLeg',model:FindFirstChild'RightLowerLeg',
- model:FindFirstChild'RightFoot',model:FindFirstChild'UpperTorso',model:FindFirstChild'LowerTorso';
- local Set={{{LArm;{Orientation=Vector3.new(0,180,0);Position=Vector3.new(-1,1,0)};{Orientation=
- Vector3.new(0,180,0);Position=Vector3.new(.5,1,0)};{LimitsEnabled=true;UpperAngle=15;
- TwistLimitsEnabled=true;UpperAngle=-45;TwistLowerAngle=-45;};};{RArm;{Orientation=Vector3.new(0,0,0)
- ;Position=Vector3.new(1,1,0);};{Orientation=Vector3.new(0,0,0);Position=Vector3.new(-.5,1,0);};{
- LimitsEnabled=true;UpperAngle=15;TwistLimitsEnabled=true;UpperAngle=-45;TwistLowerAngle=-45;};};{
- RLeg;{Orientation=Vector3.new(90,0,-90);Position=Vector3.new(.5,-1,0);};{Orientation=Vector3.new(90,
- 0,-90);Position=Vector3.new(0,1,0);};{LimitsEnabled=true;UpperAngle=165;};};{LLeg;{Orientation=
- Vector3.new(90,0,-90);Position=Vector3.new(-.5,-1,0);};{Orientation=Vector3.new(90,0,-90);Position=
- Vector3.new(0,1,0);};{LimitsEnabled=true;UpperAngle=165;};};{head;{Orientation=Vector3.new(180,90,0)
- ;Position=Vector3.new(0,1,0);};{Orientation=Vector3.new(180,90,0);Position=Vector3.new(0,-.5,0);};{
- LimitsEnabled=true;UpperAngle=75;TwistLimitsEnabled=true;UpperAngle=-45;TwistLowerAngle=-45};};};{{
- LF;LLL;'LeftAnkleRigAttachment';};{LLL;LUL;'LeftKneeRigAttachment';};{LUL;LT;'LeftHipRigAttachment';
- };{RF;RLL;'RightAnkleRigAttachment';};{RLL;RUL;'RightKneeRigAttachment';};{RUL;LT;
- 'RightHipRigAttachment';};{LH;LLA;'LeftWristRigAttachment';};{LLA;LUA;'LeftElbowRigAttachment';};{
- LUA;UT;'LeftShoulderAttachment';'LeftCollarAttachment'};{RH;RLA;'RightWristRigAttachment';};{RLA;
- RUA;'RightElbowRigAttachment';};{RUA;UT;'RightShoulderAttachment';'RightCollarAttachment'};{LT;UT;
- 'WaistRigAttachment'};{UT;head;'NeckRigAttachment';nil;{LimitsEnabled=true;UpperAngle=-75;
- TwistLimitsEnabled=true;UpperAngle=-45;TwistLowerAngle=-45;};};};};hum.Died:Connect(function()
- for _,a in pairs(model:GetDescendants())do if a:IsA'Motor6D'then a:Destroy();end;end;
- if hum.RigType==Enum.HumanoidRigType.R6 then for _,a in pairs(Set[1])do local b,c;if torso then
- a[2].Parent,a[2].Orientation=torso,a[2].Orientation+torso.Orientation;b=Instance_2('Attachment',a[2
- ]);end;if a[1]then a[3].Parent,a[3].Orientation=a[1],a[3].Orientation+a[1].Orientation;
- c=Instance_2('Attachment',a[3]);end;a[4].Parent,a[4].Attachment0,a[4].Attachment1=torso,b,c;
- Instance_2('BallSocketConstraint',a[4])end;else for _,a in pairs(Set[2])do local b=a[5]or{};if a[1]then
- b.Attachment0=a[1][a[3]];end;if a[2]then b.Attachment1=a[2][a[4]or a[3]];end;b.Parent=UT;
- Instance_2('BallSocketConstraint',b);end;end;end);end;
- for _,a in pairs(workspace:GetChildren())do Ragdoll_v2(a);end;workspace.ChildAdded:Connect(Ragdoll_v2);
- local ChangeIndex,FindFirstChildOrEtc,Storage,IndexFromTuple,TableFillNil,SunIsFighting,TableRandom,
- GiveNameBasedFromName_ID,cwrap,RunService,WaitForChild,Players,SunName,IsFighting=
- function(tab,ind,pri)for a,b in pairs(ind)do local _,c=pcall(function()tab[a]=b;end);
- if pri and c then print(c);end;end;end,function(par,children)for _,a in pairs(children)do
- local b=par:FindFirstChild(a);if b then return b;end;end;end,{},function(t,...)
- for _,a in pairs{...;}do t=t[a];end;return t;end,function(t,v)for a=1,#t do if t[a]==nil then
- t[a]=v;return a;end;end;table.insert(t,v);end,{},function(a)return a[math.random(1,#a)];end,
- function(a)local b=Name_ID[a];if not b then return;end;Name_ID[a]=Name_ID[a]+1;
- return a..Name_ID[a];end,function(a)coroutine.wrap(a)();end,game:GetService("RunService"),
- function(par,name,wt)repeat local a=par:FindFirstChild(name);if a then return a;end;
- wait(wt or 1/60);until nil;end,game:GetService("Players"),nil;
- local TableCompareValueFromIndexes,TweenService,SuperHotSunMode=function(t,v,...)for b,a in pairs(t)do
- if v==IndexFromTuple(a,...)then return b;end;end;end,game:GetService("TweenService"),false;
- local Instance2,Remove=function(cn,prop)
- local a=(function()local b=TableCompareValueFromIndexes(Storage,cn,'ClassName');if not b then
- return;end;local c=Storage[b];if not c then return;end;Storage[b]=nil;return c;end)()or Instance.
- new(cn);ChangeIndex(a,prop,1);return a;end,function(a)local c=function(d)pcall(function()
- d.Parent=nil;TableFillNil(Storage,d);end);end;for _,b in pairs(a:GetDescendants())do c(b);
- end;c(a);end;
- Instance_2=Instance2;
- local Damage,DelayRemove=function(part,dam,hitfunction)if not part then return;end;
- local a=part:FindFirstAncestorWhichIsA'Model';if not a then return;end;
- local b,c=a:FindFirstChildWhichIsA'Humanoid',FindFirstChildOrEtc(a,{'Head';'Torso';'UpperTorso';
- 'HumanoidRootPart';});if a==workspace then return;end;local d=Players:GetPlayerFromCharacter(a);
- if d and Settings.NeedsPermission then if not table.find(SunIsFighting,d.Name)then return;end;
- end;hitfunction=hitfunction or function()end;
- if b then if not b:GetStateEnabled(Enum.HumanoidStateType.Dead)then
- b:SetStateEnabled(Enum.HumanoidStateType.Dead,true);end;if b.Health>101 then b.Health=0;
- hitfunction();else b:TakeDamage(dam);hitfunction();end;elseif c then Remove(c);else
- pcall(function()a:BreakJoints();end);end;end,function(a,b)delay(a or 1,function()Remove(b);end);end;
- local FightOptInPart=function()local Object_0=Instance_2("Part",{Color=Color3.new(0,1,0);CFrame=
- CFrame.new(0,.5,-20,1,0,0,0,1,0,0,0,1);Size=Vector3.new(4,1,4);BottomSurface='Smooth';Anchored
- =true;Parent=workspace;TopSurface='Smooth';});local Object_1=Instance_2("BillboardGui",{
- AlwaysOnTop=true;ExtentsOffsetWorldSpace=Vector3.new(0,10,0);MaxDistance=30;Parent=Object_0;Size=
- UDim2.new(10,0,2,0);});Instance_2("TextLabel",{TextWrapped=true;Parent=Object_1;
- TextStrokeTransparency=0;Size=UDim2.new(1,0,1,0);BorderColor3=Color3.new(.105882,.164706,.207843)
- ;Text=[==[Step Here to run away from/Fight the Sun]==];TextColor3=Color3.new(1,1,1);Font='Code';
- BackgroundTransparency=1;TextScaled=true;});local deb=true;local d=function()
- Object_0.BrickColor=BrickColor.new("Lime green");deb=true;end;Object_0.Touched:Connect(function(a)
- if not deb or not a then return;end;Object_0.BrickColor=BrickColor.new"Really red";deb=false;
- local b=a:FindFirstAncestorWhichIsA'Model';local c=game:GetService'Players';if not(b and c)then d();return;
- end;local e=c:GetPlayerFromCharacter(b);if not e then d();return;end;local f=table.find(SunIsFighting,e.Name
- )if f then SunIsFighting[f]=nil;else TableFillNil(SunIsFighting,e.Name);end;wait(2);d();deb=true;end);
- Object_0.Name=GiveNameBasedFromName_ID'OptInPart';end;
- if Settings.NeedsPermission then
- FightOptInPart();
- else
- local a=function(b)TableFillNil(SunIsFighting,b.Name);end;
- local c=game:GetService("Players");
- for _,b in pairs(c:GetPlayers())do a(b);end;
- c.PlayerAdded:Connect(a);
- end;
- local CreateTheSUN=function()
- local Health=100;
- SunName=GiveNameBasedFromName_ID'THESUN';
- local Object_0=Instance_2("Part",{Color=Color3.new(1,1,0);CFrame=CFrame.new(0,0,-50,1,0,0,0,1,0,0,0,1);
- Material='Neon';Size=Vector3.new(10,10,10);BottomSurface='Smooth';CanCollide=false;Anchored=true;
- Name=SunName;Parent=workspace;Shape='Ball';TopSurface='Smooth';});local a=Instance_2("Part",{Color=
- Color3.new(1,1,0);CFrame=Object_0.CFrame;Name='a';Material='ForceField';Size=Vector3.new(11,11,11);
- BottomSurface='Smooth';CanCollide=false;Anchored=true;Transparency=.5;Parent=Object_0;Shape='Ball';
- TopSurface='Smooth';});local b=Instance_2("Part",{Color=Color3.new(1,1,0);CFrame=Object_0.CFrame;Name=
- 'b';Material='Slate';Size=Vector3.new(10.5,10.5,10.5);BottomSurface='Smooth';CanCollide=false;
- Anchored=true;Transparency=.15000000596046;Parent=Object_0;Shape='Ball';TopSurface='Smooth';});
- local Song=Instance2('Sound',{Name='BossFightTheme';Volume=0;SoundId='rbxassetid://3355655842';
- Looped=true;Parent=Object_0;});Song:Play();
- local HealthBG=Instance2('BillboardGui',{AlwaysOnTop=true;StudsOffsetWorldSpace=Vector3.new(0,
- 10,0);Name='Health';Size=UDim2.new(10,0,2,0);ClipsDescendants=false;Parent=Object_0;});
- Instance2('TextBox',{BackgroundTransparency=1;Size=UDim2.new(1,0,1,0);Font='Code';Text='Heat='..
- Health;Name='a';TextColor3=Color3.fromRGB(255,255,255);TextScaled=true;Parent=HealthBG;
- TextStrokeTransparency=0;});
- local THE_SUN=Object_0;
- local h=true;
- THE_SUN.Touched:Connect(function(i)if not h then return;end;h=false;Damage(i,10);h=true;end);
- local IsInMove=true;local CurrentMove=1;
- local IsDefeated=false;
- local FightingMoves={
- function()if not IsInMove then return;end;IsInMove=false;local LaserSound=THE_SUN:FindFirstChild
- 'SoundFX1'or Instance2('Sound',{Parent=THE_SUN;Name='SoundFX1';});ChangeIndex(LaserSound,{
- Looped=true;Volume=1;SoundId='rbxassetid://1447681819';EmitterSize=10000;});LaserSound:Play();
- for c=1,120 do if IsFighting then
- if IsFighting.Character then
- if IsFighting.Character:FindFirstChild'HumanoidRootPart'then
- local POS=IsFighting.Character.HumanoidRootPart.Position;local d=workspace:FindFirstChild
- 'SunBossBeam∞'or(function()local e=Instance2('Part',{Name='SunBossBeam∞';BrickColor=BrickColor
- .new("New Yeller");Parent=workspace;Material='Neon';Anchored=true;CanCollide=false;Position=
- Vector3.new(0,10,0);Size=Vector3.new(.1,.1,.1);Transparency=0;Shape='Block';});local g=true;
- e.Touched:Connect(function(f)if not g then return;end;g=false;Damage(f,2);wait(.25);g=true;
- end);return e;end)();wait();local e=(THE_SUN.Position-POS).Magnitude;d.CFrame=CFrame.new(
- THE_SUN.Position,POS);d.CFrame=d.CFrame*CFrame.new(0,0,-((e/2)+5));d.Size=Vector3.new(.25,.25,
- e+5);wait();end;elseif not IsFighting then if workspace:FindFirstChild'SunBossBeam∞'then
- Remove(workspace:FindFirstChild'SunBossBeam∞');end;break;end;
- end;
- end;LaserSound:Stop();IsInMove=
- true;end;
- function()if not IsInMove then return;end;IsInMove=false;SuperHotSunMode=true;TweenService:Create(
- THE_SUN,TweenInfo.new(3,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0),{Color=
- Color3.fromRGB(0,0,255);}):Play();wait(10);TweenService:Create(THE_SUN,TweenInfo.new(3,Enum.
- EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0),{Color=Color3.fromRGB(255,255,0);}):
- Play();SuperHotSunMode=false;wait(3);IsInMove=true;end;
- };
- cwrap(function()
- while true do
- (function()
- if #SunIsFighting==0 then return;end;
- local targetplayer;
- local targetcharacter;
- repeat
- if #SunIsFighting>0 and not IsDefeated then
- pcall(function()
- targetplayer=Players:FindFirstChild(TableRandom(SunIsFighting));
- end);
- if targetplayer then
- targetcharacter=targetplayer.Character;
- if targetcharacter then
- if targetcharacter.Parent~=nil and targetcharacter:FindFirstChild'HumanoidRootPart'then
- IsFighting=targetplayer;
- break;
- end;
- end;
- end;
- end;
- wait(.1);
- IsFighting=nil;
- until IsDefeated;
- if IsFighting then
- TableRandom(FightingMoves)();
- if workspace:FindFirstChild('SunBossBeam∞')then
- Remove(workspace:FindFirstChild('SunBossBeam∞'))
- end
- if IsFighting and HealthBG:FindFirstChild'a'and HealthBG.Parent~=nil then
- HealthBG.a.Text='~ Cooling ~';
- Health=Health - 1;
- wait(1);
- HealthBG.a.Text='Heat = '.. Health;
- if Health<=0 then
- wait(.5);
- HealthBG.a.Text='The Sun cooled too much.';
- IsFighting = nil;
- IsDefeated = true;
- TweenService:Create(THE_SUN,TweenInfo.new(3,Enum.EasingStyle.Quint,Enum.
- EasingDirection.Out,0,false,0),{Color=Color3.fromRGB(255,255,255);})
- :Play();
- wait(4);
- for _=1,200 do
- THE_SUN.Position = THE_SUN.Position - Vector3.new(0,.1,0);
- wait(.1);
- end;
- end;
- end;
- end;
- end)()
- wait(1);
- end;
- end);
- end;
- CreateTheSUN()
- workspace.ChildRemoved:Connect(function(a)
- for b in pairs(Name_ID)do
- if b==a.Name:sub(1,b:len())then
- if b=='OptInPart'and not workspace:FindFirstChild('OptInPart'..Name_ID.OptInPart)then
- wait(2);FightOptInPart();
- elseif b=='THESUN'and not workspace:FindFirstChild('THESUN'..Name_ID.THESUN)then
- wait(2);CreateTheSUN();
- end;
- break;
- end;
- end;
- end);
- cwrap(function()
- while true do
- local a=WaitForChild(workspace,'THESUN'..Name_ID.THESUN,.1);
- local b=Instance2('Part',{Color=a.Color;Material='Neon';
- Transparency=0;Parent=workspace;Position=a.Position;CanCollide=false;Anchored=true;
- Shape='Ball';Size=Vector3.new(10,10,10)});DelayRemove(1.5,b);
- game:GetService("TweenService"):Create(b,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.
- EasingDirection.Out,0,false,0),{Transparency=1;Size=(SuperHotSunMode and Vector3.new(
- 100,100,100))or Vector3.new(20,20,20);}):Play();
- local e;
- if SuperHotSunMode then
- e=b.Touched:Connect(function(c)
- if not SuperHotSunMode then
- return;end;
- Damage(c,10,function()
- if not e then return;end;
- e:Disconnect();
- end);
- wait(.25);
- end);
- end;
- wait(2);
- end;
- end);
- cwrap(function()
- while true do
- if IsFighting then
- if not table.find(SunIsFighting,IsFighting.Name)then
- IsFighting=nil;
- end;
- end;
- local a=WaitForChild(workspace,'THESUN'.. Name_ID.THESUN ,1);
- local b=a:FindFirstChild'BossFightTheme';
- if b then
- if b.Volume<5 and IsFighting then
- b.Volume=b.Volume + .05;
- elseif b.Volume>0 and not IsFighting then
- b.Volume=b.Volume - .05;
- end;
- end;
- if IsFighting then
- if IsFighting.Character:FindFirstChild'HumanoidRootPart'then
- local HRPPOS=IsFighting.Character.HumanoidRootPart.Position;
- if a.Position.Y>HRPPOS.Y+7 then
- a.Position=a.Position - Vector3.new(0,.1,0);
- elseif a.Position.Y<HRPPOS.Y+6 then
- a.Position=a.Position + Vector3.new(0,.1,0);
- end;
- local d=a.Position
- a.CFrame=CFrame.new(d,Vector3.new(HRPPOS.x,d.y,HRPPOS.z));
- a.CFrame=a.CFrame*CFrame.new(0,0,-1);
- end;
- end;
- for _,c in pairs{a:FindFirstChild'a';a:FindFirstChild'b';}do
- if c then
- c.Color=a.Color
- c.Position=a.Position
- end;
- end;
- wait(.1);
- end;
- end);
- Players.PlayerRemoving:Connect(function(b)
- local a=table.find(SunIsFighting,b.Name);
- if a then SunIsFighting[a]=nil;end;
- end);
- end;
- THE_SUN(loadstring'return owner;'()or game.Players:WaitForChild('SoftlockedUnderZero'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement