You will be given a Luau script (that has been decompiled). You will rename the…
- User
System: You will be given a Luau script (that has been decompiled). You will rename the variables and functions to sound better, make the script more coherent, and add comments to areas of the script. Return the fixed script without adding ``` as we handle that. If no script has been given, do not produce any output. Do not respond with anything but the script User: --decompiled with swift using medal decompiler --MEDAL GITHUB: https://github.com/shrimp-nz/medal --Give them a star!
local v_u_1 = game:GetService("ReplicatedStorage").Assets local v_u_2 = game:GetService("ReplicatedStorage").Events local v3 = game:GetService("ReplicatedStorage").Modules local v_u_4 = game:GetService("RunService") game:GetService("TweenService") local v_u_5 = require(v3.Core.Shared) require(v3.Core.Assets) local v_u_6 = require(v3.Gameplay.VFX) require(v3.Gameplay.Storyline) local v_u_7 = require(v3.Gameplay.Cutscenes) local v_u_8 = require(v3.Core.Matchmaking) local v_u_9 = v_u_8["Difficulty Nomenclature"][v_u_1.Session.Difficulty.Value] local v_u_10 = { ["Damage vs Classes"] = { ["Organic"] = 1, ["Armored"] = 1, ["MiniBoss"] = 5, ["Boss"] = 10, ["Structure"] = 1, ["Aerial"] = 1, ["Naval"] = 1, ["Terrestrial"] = 1, ["Calamity"] = 1, ["Overseer"] = 2 } } local v11 = { [2] = { ["ID"] = 9266225945, ["Volume"] = 1.25, ["Pitch"] = 1 }, [3] = { ["ID"] = 9266229285, ["Volume"] = 1.25, ["Pitch"] = 1 }, ["Anticipation"] = { ["ID"] = 9266232046, ["Volume"] = 1.25, ["Pitch"] = 1 }, [4] = { ["ID"] = 9266235435, ["Volume"] = 1, ["Pitch"] = 1 } } v_u_10.Themes = v11 v_u_10.TimeToMove = 10 v_u_10["Passive Debuff"] = "Incrypted Fracture" local v12 = { ["Damage"] = 10, ["Rate"] = 0.0125, ["Range"] = 250, ["Element"] = { ["Type"] = "???", ["Color"] = Color3.fromRGB(170, 170, 255) } } v_u_10["Incrypted Fracture"] = v12 v_u_10.Anticipation = false local v13 = { ["Enabled"] = true, ["Level"] = 0 } local v14 = { { ["Min"] = 0.7, ["Max"] = 0.9 }, { ["Min"] = 0.55, ["Max"] = 0.7 }, { ["Min"] = 0.385, ["Max"] = 0.55 }, { ["Min"] = 0, ["Max"] = 0.385 } } v13.Segments = v14 v_u_10.Phases = v13 v_u_10["Special Attacks"] = { ["Enabled"] = false, ["Rate"] = 5, ["Multiplier"] = 1, ["Used"] = false, ["Moveset"] = {} } local function v_u_20(p15) if p15 then if p15.Parent:FindFirstChild("Humanoid") and p15.Parent.Humanoid.Health < 2 then return else local v16 = p15:FindFirstChildOfClass("BodyPosition") if v16 then local v17 = Random.new():NextNumber(-200, -437) local v18 = Random.new():NextNumber(50, 60) local v19 = Random.new() v16.Position = Vector3.new(v17, v18, v19:NextNumber(-100, 100)) end end else return end end local function v_u_25(p21, p22, p23, _, p24, ) -- upvalues: (copy) v_u_1, (copy) v_u_5 if p21 and (p24 and (p24.Parent and (p22 and p22.Health > 0))) then if not p21.MinDifficulty or v_u_1.Session.Difficulty.Value >= p21.MinDifficulty then if p21.Cue and p21.Cue.ID then v_u_5.CreateSound(p21.Cue, p23) end end else return end end function v_u_10.Equip(, _) end function v_u_10.Attack(p_u_26) -- upvalues: (copy) v_u_2, (copy) v_u_1, (copy) v_u_5, (copy) v_u_10, (copy) v_u_6, (copy) v_u_9, (copy) v_u_8, (copy) v_u_4, (copy) v_u_7, (copy) v_u_20, (copy) v_u_25 local v_u_27 = p_u_26:WaitForChild("Humanoid", 2) local v_u_28 = p_u_26:WaitForChild("TEAM", 2) local v_u_29 = p_u_26.PrimaryPart local v_u_30 = nil p_u_26:FindFirstChildOfClass("Tool") local v_u_31 = Instance.new("ForceField") v_u_31.Visible = false v_u_31.Parent = p_u_26 local _ = v_u_27.WalkSpeed local v_u_32 = v_u_29.Aim local v_u_33 = p_u_26:FindFirstChild("Stats") if v_u_33 then v_u_33 = require(p_u_26.Stats) end local _ = v_u_2.Gameplay.VFX local v_u_34 = RaycastParams.new() local v_u_35 = RaycastParams.new() if v_u_29:FindFirstChildOfClass("BodyPosition") then v_u_29:FindFirstChildOfClass("BodyPosition").Position = Vector3.new(-209.178, 64.734, 0.228) end local v36 = Random.new():NextInteger(0, 100) local v_u_37 = math.abs(v36) <= 1 v_u_27:SetStateEnabled(Enum.HumanoidStateType.Dead, false) local v_u_38 = v_u_1.Core.Miscellaneous:WaitForChild("Erelphos Runes"):Clone() v_u_38.Owner.Value = p_u_26 for _, v39 in pairs(v_u_38:GetDescendants()) do if v39:IsA("BasePart") then if v39.Name == "Out" then v39.Transparency = 1 else v39.Transparency = 1 end end if v39:IsA("Beam") then v39.Enabled = false end end v_u_38.Parent = workspace.JunkHolder local function v_u_44(p40) -- upvalues: (copy) v_u_33 local v41 = true local v42 if p40 then v42 = p40:FindFirstChild("Humanoid") else v42 = p40 end local v43 = p40 and v_u_33.Ranged == true and p40:FindFirstChild("Head") if not v43 then if p40 then v43 = p40.PrimaryPart else v43 = p40 end end if p40 then p40 = p40:FindFirstChild("TEAM") end if v42 and (v43 and p40) then v41 = false end return v41, v42, v43, p40 end local function v_u_69(p45) -- upvalues: (copy) v_u_29, (ref) v_u_5, (copy) p_u_26, (copy) v_u_33, (copy) v_u_28, (copy) v_u_34, (copy) v_u_44 local v46 = v_u_29.CFrame * CFrame.new(0, 1.5, 0).Position local v47 = v_u_5.CreateIgnoreList(p_u_26, false, true) local v48 = {} local v49 = (1 / 0) for _, v50 in pairs(workspace:GetChildren()) do if v50:FindFirstChild("Humanoid") and (v50.Humanoid:GetState() ~= Enum.HumanoidStateType.Dead and (not v50:FindFirstChildOfClass("ForceField") and v50 ~= p_u_26)) then local v51 = v50:FindFirstChild("Humanoid") local v52 = v_u_33.Ranged == true and v50:FindFirstChild("Head") or v50.PrimaryPart local v53 = v50:FindFirstChild("TEAM") if v51 and (v51:GetState() ~= Enum.HumanoidStateType.Dead and (v52 and (v53 and v53.Value ~= v_u_28.Value))) then local v54 = CFrame.new(v46, v52.CFrame.Position).LookVector local v55 = v_u_34 local v56 = v_u_34 local v57 = v_u_34 local v58 = Enum.RaycastFilterType.Exclude v55.FilterDescendantsInstances = v47 v56.FilterType = v58 v57.IgnoreWater = true local v59 = workspace:Raycast(v46, v54 * 2048, v_u_34) local v60 if v59 then v60 = v59.Instance local _ = v59.Position else v60 = nil end if v60 and (v60.Parent and v60:IsDescendantOf(v50)) then table.insert(v48, v50) end end end end local v61 = nil for _, v62 in pairs(v48) do local v63 = v62:FindFirstChild("Humanoid") local v64 = v_u_33.Ranged == true and v62:FindFirstChild("Head") or v62.PrimaryPart local v65 = v62:FindFirstChild("TEAM") if v63 and (v63:GetState() ~= Enum.HumanoidStateType.Dead and (v63.Health > 0 and (v64 and (v65 and (v65.Value ~= v_u_28.Value and (v64.Position - p45).Magnitude < v49))))) then v49 = (v64.Position - p45).Magnitude v61 = v62 end end local _, v66, v67, v68 = v_u_44(v61) return v61, v66, v67, v68 end coroutine.wrap(function() -- upvalues: (copy) p_u_26, (copy) v_u_27, (ref) v_u_10, (ref) v_u_6, (copy) v_u_29, (ref) v_u_37, (ref) v_u_2, (copy) v_u_28, (ref) v_u_5, (ref) v_u_9, (ref) v_u_8, (copy) v_u_69, (copy) v_u_35, (ref) v_u_30, (copy) v_u_32, (ref) v_u_4, (ref) v_u_7 while p_u_26.Parent and (v_u_27 and v_u_27.Health > 1) do if v_u_10.Phases and (v_u_10.Phases.Enabled == true and #v_u_10.Phases.Segments > 0) then for v70, v71 in pairs(v_u_10.Phases.Segments) do if (v71.Min and (v71.Max and (v_u_27.Health >= v_u_27.MaxHealth * v71.Min and v_u_27.Health < v_u_27.MaxHealth * v71.Max)) or v71.Min and (not v71.Max and v_u_27.Health >= v_u_27.MaxHealth * v71.Min)) and v_u_10.Phases.Level < v70 then v_u_10.Phases.Level = v70 if v70 == 1 then v_u_6.CueSpecial(v_u_29, { ["Range"] = 60, ["Color"] = Color3.fromRGB(0, 255, 0), ["FadeTime"] = 2, ["Transparency"] = 0 }) end if v70 == 2 then v_u_6.CueSpecial(v_u_29, { ["Range"] = 60, ["Color"] = Color3.fromRGB(85, 255, 255), ["FadeTime"] = 2, ["Transparency"] = 0 }) if v_u_37 == false then v_u_2.Core.Master:FireAllClients("PlayMusic", { ["Music"] = v_u_10.Themes[2] }) end end if v70 == 3 then v_u_6.CueSpecial(v_u_29, { ["Range"] = 60, ["Color"] = Color3.fromRGB(255, 0, 0), ["FadeTime"] = 2, ["Transparency"] = 0 }) if v_u_37 == false then v_u_2.Core.Master:FireAllClients("PlayMusic", { ["Music"] = v_u_10.Themes[3] }) end end if v70 == 4 and v_u_37 == false then v_u_10.Anticipation = true v_u_2.Core.Master:FireAllClients("PlayMusic", { ["Music"] = v_u_10.Themes.Anticipation }) local v72 = Instance.new("ForceField") v72.Visible = false v72.Parent = p_u_26 task.wait(20.247) v_u_10.Anticipation = false if v72 then v72:Destroy() end v_u_6.CueSpecial(v_u_29, { ["Range"] = 60, ["Color"] = Color3.fromRGB(255, 255, 0), ["FadeTime"] = 2, ["Transparency"] = 0 }) v_u_2.Core.Master:FireAllClients("PlayMusic", { ["Music"] = v_u_10.Themes[4] }) if p_u_26:FindFirstChild("Classification") then local v73 = Instance.new("BoolValue") v73.Name = "Raged" v73.Value = true v73.Parent = p_u_26 end end end end end for _, v74 in pairs(workspace:GetChildren()) do if v74:FindFirstChild("Humanoid") and (v74.Humanoid.Health > 0 and (v74.PrimaryPart and (not v74:FindFirstChildOfClass("ForceField") and v74 ~= p_u_26))) then local v75 = v74.Humanoid local v76 = v74.PrimaryPart local v77 = v74:FindFirstChild("TEAM") game:GetService("Players"):GetPlayerFromCharacter(v74) if v77 and v77.Value ~= v_u_28.Value then v_u_2.Binds.Ailments:Fire("AddAilmentToPlayer", { ["User"] = v74, ["Item"] = nil, ["Duration"] = nil, ["AttributesFolder"] = nil, ["Parent"] = "Ailments", ["Visual"] = false, ["Bind"] = nil, ["Module"] = nil, ["EffectName"] = v_u_10["Passive Debuff"], ["Predecessor"] = p_u_26 }) end if (v76.Position - workspace.Statue.PrimaryPart.Position).Magnitude < 4096 and ((v76.Position - workspace.Statue.PrimaryPart.Position).Magnitude >= v_u_10["Incrypted Fracture"].Range and v75.Health > 0) then v_u_2.Gameplay.VFX:FireAllClients("Start Incrypted Fracture", { ["Character"] = v74 }) local v78 = v_u_5.ModifyEnemyStats({ ["User"] = p_u_26, ["Target"] = v74, ["Damage"] = v_u_10["Incrypted Fracture"].Damage * (v_u_9 and v_u_9.DamageMultiplier or 1) * v_u_8["Global Scaling"], ["KB"] = nil, ["Element"] = v_u_10["Incrypted Fracture"].Element }) if v78 > 0 then v75:TakeDamage(v78) end else v_u_2.Gameplay.VFX:FireAllClients("Stop Incrypted Fracture", { ["Character"] = v74 }) end end end local v79, v80, v81, v82 = v_u_69(v_u_29.CFrame.Position) if v79 and (v80 and (v81 and v82)) then local v83 = v_u_29.CFrame * CFrame.new(0, 1.5, 0).Position local v84 = CFrame.new(v83, v81.CFrame.Position).LookVector local v85 = v_u_5.CreateIgnoreList(p_u_26, false, true) local v86 = v_u_35 local v87 = v_u_35 local v88 = v_u_35 local v89 = Enum.RaycastFilterType.Exclude v86.FilterDescendantsInstances = v85 v87.FilterType = v89 v88.IgnoreWater = true local v90 = workspace:Raycast(v83, v84 * 2048, v_u_35) if v90 then local _ = v90.Instance local _ = v90.Position end v_u_30 = v79 v_u_32.CFrame = CFrame.new(v_u_29.CFrame.Position, v_u_30.PrimaryPart.Position) end v_u_4.Heartbeat:Wait() end if p_u_26 and p_u_26.Parent then for _, v91 in pairs(workspace:GetChildren()) do v_u_2.Gameplay.VFX:FireAllClients("Stop Incrypted Fracture", { ["Character"] = v91 }) end v_u_2.Gameplay.VFX:FireAllClients("Cleanup Incrypted Fracture") v_u_27:SetStateEnabled(Enum.HumanoidStateType.Dead, false) v_u_27.Health = 1 local v92 = Instance.new("ForceField") v92.Parent = p_u_26 v92.Visible = false local v93 = { ["NPC"] = p_u_26 } v_u_7.Scene("Erelphos", v93) v_u_2.Core.Master:FireAllClients("Create Cutscene", { ["Camera"] = nil, ["Settings"] = v_u_7.Scenes_Settings.Erelphos }) end end)() coroutine.wrap(function() -- upvalues: (copy) v_u_31, (ref) v_u_6, (copy) v_u_29, (copy) v_u_38, (ref) v_u_37, (copy) p_u_26, (ref) v_u_5, (ref) v_u_2, (copy) v_u_27, (ref) v_u_10, (ref) v_u_20 task.wait(12) if v_u_31 then v_u_31:Destroy() end v_u_6.CueSpecial(v_u_29, { ["Range"] = 150, ["Color"] = Color3.fromRGB(255, 255, 255), ["FadeTime"] = 1, ["Transparency"] = 0 }) for _, v94 in pairs(v_u_38:GetDescendants()) do if v94:IsA("BasePart") then if v94.Name == "Out" then v94.Transparency = -5 else v94.Transparency = 0 end end if v94:IsA("Beam") then v94.Enabled = true end end v_u_38.CoreRune.Decoration.MiddleRing.Transparency = 1 if v_u_37 == true then p_u_26.Name = "SUPREME KEVINBOP!" if p_u_26:FindFirstChild("Bloxxercap") then p_u_26.Bloxxercap.Handle.Transparency = 0 end if p_u_26:FindFirstChild("Sideswept Bangs Brown") then p_u_26["Sideswept Bangs Brown"].Handle.Transparency = 0 end p_u_26.Head:FindFirstChildOfClass("Decal").Transparency = 0 p_u_26.HumanoidRootPart:FindFirstChildOfClass("Decal").Transparency = 0 v_u_5.CreateSound({ ["ID"] = 7989088301, ["Volume"] = 20, ["Pitch"] = 1 }, workspace) local v95 = { ["Music"] = { ["ID"] = 8192674140, ["Volume"] = 1, ["Pitch"] = 1 } } v_u_2.Core.Master:FireAllClients("PlayMusic", v95) p_u_26.Humanoid.HealthChanged:Connect(function() -- upvalues: (ref) v_u_5, (ref) v_u_29 v_u_5.CreateSound({ ["ID"] = 8603227350, ["Volume"] = 0.5, ["Pitch"] = 1 }, v_u_29) end) end while p_u_26.Parent and (v_u_27 and v_u_27.Health > 1) do task.wait(v_u_10.TimeToMove) if v_u_27.Health <= 1 then return end v_u_20(v_u_29) end end)() if v_u_10["Special Attacks"].Enabled == true then coroutine.wrap(function() -- upvalues: (ref) v_u_10, (ref) v_u_25, (copy) v_u_27, (copy) v_u_29, (copy) v_u_28, (copy) p_u_26, (ref) v_u_30, (ref) v_u_4 while true do wait(v_u_10["Special Attacks"].Rate * v_u_10["Special Attacks"].Multiplier) if v_u_10["Special Attacks"].Used == false and #v_u_10["Special Attacks"].Moveset > 0 then local v96 = v_u_10["Special Attacks"].Moveset[Random.new():NextInteger(1, #v_u_10["Special Attacks"].Moveset)] v_u_10["Special Attacks"].Used = true v_u_25(v96, v_u_27, v_u_29, v_u_28, p_u_26, v_u_30) wait(v96.Cooldown) v_u_10["Special Attacks"].Used = false end v_u_4.Heartbeat:Wait() if not p_u_26.Parent or v_u_27 and v_u_27:GetState() == Enum.HumanoidStateType.Dead then return end end end)() end end return v_u_10
Assistant:
- Assistant
local Assets = game:GetService("ReplicatedStorage").Assets local Events = game:GetService("ReplicatedStorage").Events local Modules = game:GetService("ReplicatedStorage").Modules local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService")
local Shared = require(Modules.Core.Shared) require(Modules.Core.Assets) local VFX = require(Modules.Gameplay.VFX) require(Modules.Gameplay.Storyline) local Cutscenes = require(Modules.Gameplay.Cutscenes) local Matchmaking = require(Modules.Core.Matchmaking)
local difficultyNomenclature = Matchmaking["Difficulty Nomenclature"][Assets.Session.Difficulty.Value]
local AttackConfig = { ["Damage vs Classes"] = { ["Organic"] = 1, ["Armored"] = 1, ["MiniBoss"] = 5, ["Boss"] = 10, ["Structure"] = 1, ["Aerial"] = 1, ["Naval"] = 1, ["Terrestrial"] = 1, ["Calamity"] = 1, ["Overseer"] = 2 } }
local ThemeSounds = { [2] = { ["ID"] = 9266225945, ["Volume"] = 1.25, ["Pitch"] = 1 }, [3] = { ["ID"] = 9266229285, ["Volume"] = 1.25, ["Pitch"] = 1 }, ["Anticipation"] = { ["ID"] = 9266232046, ["Volume"] = 1.25, ["Pitch"] = 1 }, [4] = { ["ID"] = 9266235435, ["Volume"] = 1, ["Pitch"] = 1 } }
AttackConfig.Themes = ThemeSounds AttackConfig.TimeToMove = 10 AttackConfig["Passive Debuff"] = "Incrypted Fracture"
local IncryptedFractureConfig = { ["Damage"] = 10, ["Rate"] = 0.0125, ["Range"] = 250, ["Element"] = { ["Type"] = "???", ["Color"] = Color3.fromRGB(170, 170, 255) } }
AttackConfig["Incrypted Fracture"] = IncryptedFractureConfig AttackConfig.Anticipation = false
local PhaseConfig = { ["Enabled"] = true, ["Level"] = 0, Segments = { {["Min"] = 0.7, ["Max"] = 0.9}, {["Min"] = 0.55, ["Max"] = 0.7}, {["Min"] = 0.385, ["Max"] = 0.55}, {["Min"] = 0, ["Max"] = 0.385} } }
AttackConfig.Phases = PhaseConfig
AttackConfig["Special Attacks"] = { ["Enabled"] = false, ["Rate"] = 5, ["Multiplier"] = 1, ["Used"] = false, ["Moveset"] = {} }
local function SetBodyPosition(character) if character then if character.Parent:FindFirstChild("Humanoid") and character.Parent.Humanoid.Health < 2 then return else local bodyPosition = character:FindFirstChildOfClass("BodyPosition") if bodyPosition then local randomX = Random.new():NextNumber(-200, -437) local randomY = Random.new():NextNumber(50, 60) local randomZ = Random.new() bodyPosition.Position = Vector3.new(randomX, randomY, randomZ:NextNumber(-100, 100)) end end else return end end
local function PlayAttackSound(attack, activated, target, _, attacker, _) if attack and (attacker and (attacker.Parent and (target and target.Health > 0))) then if not attack.MinDifficulty or Assets.Session.Difficulty.Value >= attack.MinDifficulty then if attack.Cue and attack.Cue.ID then Shared.CreateSound(attack.Cue, activated) end end else return end end
function AttackConfig.Equip(_, _) end
function AttackConfig.Attack(character) local humanoid = character:WaitForChild("Humanoid", 2) local team = character:WaitForChild("TEAM", 2) local primaryPart = character.PrimaryPart local tool = character:FindFirstChildOfClass("Tool")
local forceField = Instance.new("ForceField") forceField.Visible = false forceField.Parent = character local _ = humanoid.WalkSpeed local aimPart = primaryPart.Aim local stats = character:FindFirstChild("Stats") if stats then stats = require(character.Stats) end local raycastParams = RaycastParams.new() local ignoreListParams = RaycastParams.new() if primaryPart:FindFirstChildOfClass("BodyPosition") then primaryPart:FindFirstChildOfClass("BodyPosition").Position = Vector3.new(-209.178, 64.734, 0.228) end local randomValue = Random.new():NextInteger(0, 100) local isCriticalHit = math.abs(randomValue) <= 1 humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false) local erelphosRunes = Assets.Core.Miscellaneous:WaitForChild("Erelphos Runes"):Clone() erelphosRunes.Owner.Value = character for _, part in pairs(erelphosRunes:GetDescendants()) do if part:IsA("BasePart") then if part.Name == "Out" then part.Transparency = 1 else part.Transparency = 1 end end if part:IsA("Beam") then part.Enabled = false end end erelphosRunes.Parent = workspace.JunkHolder local function CheckTarget(target) local isValid = true local humanoidOfTarget if target then humanoidOfTarget = target:FindFirstChild("Humanoid") else humanoidOfTarget = target end local headOfTarget = target and stats.Ranged and target:FindFirstChild("Head") if not headOfTarget then if target then headOfTarget = target.PrimaryPart else headOfTarget = target end end if target then target = target:FindFirstChild("TEAM") end if humanoidOfTarget and (headOfTarget and target) then isValid = false end return isValid, humanoidOfTarget, headOfTarget, target end local function FindClosestTarget(position) local targetPosition = primaryPart.CFrame * CFrame.new(0, 1.5, 0).Position local ignoreList = Shared.CreateIgnoreList(character, false, true) local targetsFound = {} local closestDistance = math.huge -- Infinite distance for _, potentialTarget in pairs(workspace:GetChildren()) do if potentialTarget:FindFirstChild("Humanoid") and (potentialTarget.Humanoid:GetState() ~= Enum.HumanoidStateType.Dead and (not potentialTarget:FindFirstChildOfClass("ForceField") and potentialTarget ~= character)) then local humanoid = potentialTarget:FindFirstChild("Humanoid") local targetPart = stats.Ranged and potentialTarget:FindFirstChild("Head") or potentialTarget.PrimaryPart local teamOfTarget = potentialTarget:FindFirstChild("TEAM") if humanoid and (humanoid:GetState() ~= Enum.HumanoidStateType.Dead and (targetPart and (teamOfTarget and teamOfTarget.Value ~= team.Value))) then local direction = CFrame.new(targetPosition, targetPart.Position).LookVector local raycastParams = raycastParams raycastParams.FilterDescendantsInstances = ignoreList raycastParams.FilterType = Enum.RaycastFilterType.Exclude raycastParams.IgnoreWater = true local raycastResult = workspace:Raycast(targetPosition, direction * 2048, raycastParams) local hitTarget if raycastResult then hitTarget = raycastResult.Instance else hitTarget = nil end if hitTarget and (hitTarget.Parent and hitTarget:IsDescendantOf(potentialTarget)) then table.insert(targetsFound, potentialTarget) end end end end local closestTarget = nil for _, foundTarget in pairs(targetsFound) do local humanoid = foundTarget:FindFirstChild("Humanoid") local targetPart = stats.Ranged and foundTarget:FindFirstChild("Head") or foundTarget.PrimaryPart local teamOfTarget = foundTarget:FindFirstChild("TEAM") if humanoid and (humanoid:GetState() ~= Enum.HumanoidStateType.Dead and (humanoid.Health > 0 and (targetPart and (teamOfTarget and (teamOfTarget.Value ~= team.Value and (targetPart.Position - position).Magnitude < closestDistance))))) then closestDistance = (targetPart.Position - position).Magnitude closestTarget = foundTarget end end local _, targetHumanoid, targetHead, targetTeam = CheckTarget(closestTarget) return closestTarget, targetHumanoid, targetHead, targetTeam end coroutine.wrap(function() while character.Parent and (humanoid and humanoid.Health > 1) do if AttackConfig.Phases and (AttackConfig.Phases.Enabled and #AttackConfig.Phases.Segments > 0) then for index, segment in pairs(AttackConfig.Phases.Segments) do if (segment.Min and (segment.Max and (humanoid.Health >= humanoid.MaxHealth * segment.Min and humanoid.Health < humanoid.MaxHealth * segment.Max)) or segment.Min and (not segment.Max and humanoid.Health >= humanoid.MaxHealth * segment.Min)) and AttackConfig.Phases.Level < index then AttackConfig.Phases.Level = index if index == 1 then VFX.CueSpecial(primaryPart, { ["Range"] = 60, ["Color"] = Color3.fromRGB(0, 255, 0), ["FadeTime"] = 2, ["Transparency"] = 0 }) end if index == 2 then VFX.CueSpecial(primaryPart, { ["Range"] = 60, ["Color"] = Color3.fromRGB(85, 255, 255), ["FadeTime"] = 2, ["Transparency"] = 0 }) if isCriticalHit == false then Events.Core.Master:FireAllClients("PlayMusic", { ["Music"] = AttackConfig.Themes[2] }) end end if index == 3 then VFX.CueSpecial(primaryPart, { ["Range"] = 60, ["Color"] = Color3.fromRGB(255, 0, 0), ["FadeTime"] = 2, ["Transparency"] = 0 }) if isCriticalHit == false then Events.Core.Master:FireAllClients("PlayMusic", { ["Music"] = AttackConfig.Themes[3] }) end end if index == 4 and isCriticalHit == false then AttackConfig.Anticipation = true Events.Core.Master:FireAllClients("PlayMusic", { ["Music"] = AttackConfig.Themes.Anticipation }) local anticipationForceField = Instance.new("ForceField") anticipationForceField.Visible = false anticipationForceField.Parent = character task.wait(20.247) AttackConfig.Anticipation = false if anticipationForceField then anticipationForceField:Destroy() end VFX.CueSpecial(primaryPart, { ["Range"] = 60, ["Color"] = Color3.fromRGB(255, 255, 0), ["FadeTime"] = 2, ["Transparency"] = 0 }) Events.Core.Master:FireAllClients("PlayMusic", { ["Music"] = AttackConfig.Themes[4] }) if character:FindFirstChild("Classification") then local rageIndicator = Instance.new("BoolValue") rageIndicator.Name = "Raged" rageIndicator.Value = true rageIndicator.Parent = character end end end end end for _, potentialTarget in pairs(workspace:GetChildren()) do if potentialTarget:FindFirstChild("Humanoid") and (potentialTarget.Humanoid.Health > 0 and (potentialTarget.PrimaryPart and (not potentialTarget:FindFirstChildOfClass("ForceField") and potentialTarget ~= character))) then local humanoid = potentialTarget.Humanoid local targetPart = potentialTarget.PrimaryPart local teamOfTarget = potentialTarget:FindFirstChild("TEAM") if teamOfTarget and teamOfTarget.Value ~= team.Value then Events.Binds.Ailments:Fire("AddAilmentToPlayer", { ["User"] = potentialTarget, ["Item"] = nil, ["Duration"] = nil, ["AttributesFolder"] = nil, ["Parent"] = "Ailments", ["Visual"] = false, ["Bind"] = nil, ["Module"] = nil, ["EffectName"] = AttackConfig["Passive Debuff"], ["Predecessor"] = character }) end if (targetPart.Position - workspace.Statue.PrimaryPart.Position).Magnitude < 4096 and ((targetPart.Position - workspace.Statue.PrimaryPart.Position).Magnitude >= AttackConfig["Incrypted Fracture"].Range and humanoid.Health > 0) then Events.Gameplay.VFX:FireAllClients("Start Incrypted Fracture", { ["Character"] = potentialTarget }) local damage = Shared.ModifyEnemyStats({ ["User"] = character, ["Target"] = potentialTarget, ["Damage"] = AttackConfig["Incrypted Fracture"].Damage * (difficultyNomenclature and difficultyNomenclature.DamageMultiplier or 1) * Matchmaking["Global Scaling"], ["KB"] = nil, ["Element"] = AttackConfig["Incrypted Fracture"].Element }) if damage > 0 then humanoid:TakeDamage(damage) end else Events.Gameplay.VFX:FireAllClients("Stop Incrypted Fracture", { ["Character"] = potentialTarget }) end end end local closestTarget, targetHumanoid, targetHead, targetTeam = FindClosestTarget(primaryPart.CFrame.Position) if closestTarget and (targetHumanoid and (targetHead and targetTeam)) then local targetPos = primaryPart.CFrame * CFrame.new(0, 1.5, 0).Position local lookDirection = CFrame.new(targetPos, targetHead.CFrame.Position).LookVector local ignoreList = Shared.CreateIgnoreList(character, false, true) local raycastParams = raycastParams local ignoreRayParams = raycastParams local excludeType = Enum.RaycastFilterType.Exclude raycastParams.FilterDescendantsInstances = ignoreList raycastParams.FilterType = excludeType raycastParams.IgnoreWater = true local raycastResult = workspace:Raycast(targetPos, lookDirection * 2048, raycastParams) closestTarget = closestTarget if raycastResult then local targetInstance = raycastResult.Instance end primaryPart.CFrame = CFrame.new(primaryPart.Position, closestTarget.PrimaryPart.Position) end RunService.Heartbeat:Wait() end if character and character.Parent then for _, potentialTarget in pairs(workspace:GetChildren()) do Events.Gameplay.VFX:FireAllClients("Stop Incrypted Fracture", { ["Character"] = potentialTarget }) end Events.Gameplay.VFX:FireAllClients("Cleanup Incrypted Fracture") humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false) humanoid.Health = 1 local cleanupForceField = Instance.new("ForceField") cleanupForceField.Parent = character cleanupForceField.Visible = false local sceneInfo = { ["NPC"] = character } Cutscenes.Scene("Erelphos", sceneInfo) Events.Core.Master:FireAllClients("Create Cutscene", { ["Camera"] = nil, ["Settings"] = Cutscenes.Scenes_Settings.Erelphos }) end end)() coroutine.wrap(function() task.wait(12) if forceField then forceField:Destroy() end VFX.CueSpecial(primaryPart, { ["Range"] = 150, ["Color"] = Color3.fromRGB(255, 255, 255), ["FadeTime"] = 1, ["Transparency"] = 0 }) for _, runePart in pairs(erelphosRunes:GetDescendants()) do if runePart:IsA("BasePart") then if runePart.Name == "Out" then runePart.Transparency = -5 else runePart.Transparency = 0 end end if runePart:IsA("Beam") then runePart.Enabled = true end end erelphosRunes.CoreRune.Decoration.MiddleRing.Transparency = 1 if isCriticalHit == true then character.Name = "SUPREME KEVINBOP!" if character:FindFirstChild("Bloxxercap") then character.Bloxxercap.Handle.Transparency = 0 end if character:FindFirstChild("Sideswept Bangs Brown") then character["Sideswept Bangs Brown"].Handle.Transparency = 0 end character.Head:FindFirstChildOfClass("Decal").Transparency = 0 character.HumanoidRootPart:FindFirstChildOfClass("Decal").Transparency = 0 Shared.CreateSound({ ["ID"] = 7989088301, ["Volume"] = 20, ["Pitch"] = 1 }, workspace) local musicData = { ["Music"] = { ["ID"] = 8192674140, ["Volume"] = 1, ["Pitch"] = 1 } } Events.Core.Master:FireAllClients("PlayMusic", musicData) character.Humanoid.HealthChanged:Connect(function() Shared.CreateSound({ ["ID"] = 8603227350, ["Volume"] = 0.5, ["Pitch"] = 1 }, primaryPart) end) end while character.Parent and (humanoid and humanoid.Health > 1) do task.wait(AttackConfig.TimeToMove) if humanoid.Health <= 1 then return end SetBodyPosition(primaryPart) end end)() if AttackConfig["Special Attacks"].Enabled == true then coroutine.wrap(function() while true do wait(AttackConfig["Special Attacks"].Rate * AttackConfig["Special Attacks"].Multiplier) if AttackConfig["Special Attacks"].Used == false and #AttackConfig["Special Attacks"].Moveset > 0 then local specialAttack = AttackConfig["Special Attacks"].Moveset[Random.new():NextInteger(1, #AttackConfig["Special Attacks"].Moveset)] AttackConfig["Special Attacks"].Used = true PlayAttackSound(specialAttack, humanoid, primaryPart, team, character, _) wait(specialAttack.Cooldown) AttackConfig["Special Attacks"].Used = false end RunService.Heartbeat:Wait() if not character.Parent or humanoid and humanoid:GetState() == Enum.HumanoidStateType.Dead then return end end end)() endend
return AttackConfig