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("Players").LocalPlayer local _ = script.Parent local v_u_2 = script.Parent:WaitForChild("Radar") local v_u_3 = game:GetService("RunService") local v_u_4 = game:GetService("TweenService") game:GetService("ReplicatedStorage"):WaitForChild("Assets") game:GetService("ReplicatedStorage"):WaitForChild("Events") game:GetService("ReplicatedStorage"):WaitForChild("Modules") local v_u_5 = 0 local v_u_6 = {} local v7 = { ["Important"] = "rbxassetid://406047471", ["Structure"] = "rbxassetid://3141874560", ["Unit"] = "rbxassetid://402675744" } repeat game:GetService("RunService").RenderStepped:Wait() until v_u_1.Character.Parent and (v_u_1.Character:FindFirstChild("HumanoidRootPart") and v_u_1.Character.HumanoidRootPart.Parent) v_u_1.Character:WaitForChild("Humanoid") local v8 = v_u_1.Character:WaitForChild("TEAM") coroutine.wrap(function() -- upvalues: (copy) v_u_4, (copy) v_u_2, (copy) v_u_3 v_u_4:Create(v_u_2.Sweeper, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1, true), { ["ImageTransparency"] = 0 }):Play() while true do local v9 = game:GetService("TweenService"):Create(v_u_2.Sweeper, TweenInfo.new(1.67, Enum.EasingStyle.Linear), { ["Rotation"] = 360 }) v9:Play() v9.Completed:Wait() v_u_2.Sweeper.Rotation = 0 v_u_3.RenderStepped:Wait() end end)() coroutine.wrap(function() -- upvalues: (copy) v_u_2 while wait(3) do local v10 = game:GetService("TweenService") local v11 = v_u_2.Detector local v12 = TweenInfo.new(2, Enum.EasingStyle.Linear) local v13 = { ["Size"] = UDim2.new(1, 0, 1, 0), ["ImageTransparency"] = 1 } local v14 = v10:Create(v11, v12, v13) v14:Play() v14.Completed:Wait() v_u_2.Detector.Size = UDim2.new(0, 0, 0, 0) v_u_2.Detector.ImageTransparency = 0 end end)() local function v20(p15) -- upvalues: (copy) v_u_1, (ref) v_u_5, (ref) v_u_6 local v16 = next local v17, v18 = p15:GetChildren() for _, v19 in v16, v17, v18 do if v19:FindFirstChild("Humanoid") and (v19.Humanoid:GetState() ~= Enum.HumanoidStateType.Dead and (v19.Humanoid.Health > 0 and (v19:FindFirstChild("HumanoidRootPart") and (v19 ~= v_u_1.Character and (Vector2.new(v19.HumanoidRootPart.CFrame.X, v19.HumanoidRootPart.CFrame.Z) - Vector2.new(v_u_1.Character.HumanoidRootPart.CFrame.X, v_u_1.Character.HumanoidRootPart.CFrame.Z)).Magnitude <= v_u_5)))) then v_u_6[#v_u_6 + 1] = { v19, v19.HumanoidRootPart.CFrame.p - v_u_1.Character.HumanoidRootPart.CFrame.p } end end end while true do v_u_2.UI.Detections:ClearAllChildren() if v_u_1.Character and (v_u_1.Character:FindFirstChild("HumanoidRootPart") and (v_u_1.Character:WaitForChild("Humanoid"):GetState() ~= Enum.HumanoidStateType.Dead and v_u_1.Character:WaitForChild("Humanoid").Health > 0)) then local v21 = v_u_1.Character:GetModelSize() local v22 = v_u_1.Character.HumanoidRootPart.CFrame.LookVector local v23 = workspace.CurrentCamera.CFrame.LookVector local v24 = v22.Z local v25 = v22.X local v26 = math.atan2(v24, v25) local v27 = (v_u_2.AbsoluteSize.X + v_u_2.AbsoluteSize.Y) * 0.75 + v_u_1.Character.HumanoidRootPart.CFrame.Y / (v_u_2.AbsoluteSize.X + v_u_2.AbsoluteSize.Y) v_u_2.UI.Personnel.Rotation = math.deg(v26) + 180 local v28 = v23.Z local v29 = v23.X local v30 = math.atan2(v28, v29) v_u_2.UI.Rotation = -(math.deg(v30) - 90) local v31 = {} v20(workspace) v20(workspace.Enemies) if #v31 > 0 then local v32 = v27 for _, v33 in next, v31 do local v34 = v33[1] local v35 = v33[2] local v36 = v34:FindFirstChild("Humanoid") local v37 = v34:FindFirstChild("TEAM") local v38 = v34:FindFirstChild("HumanoidRootPart") local v39 = 0.5 + -v35.X / v32 / 2 local v40 = 0.5 + -v35.Z / v32 / 2 if v36 and (v37 and v38) then local v41 = script.Unit:Clone() local v42 = v34:GetModelSize() local v43 = v38.CFrame.lookVector local v44 = v43.Z local v45 = v43.X local v46 = math.atan2(v44, v45) local v47 = (v42.X + v42.Y + v42.Z) / 375 local v48 = math.clamp(v47, 0.075, 0.2) local v49 = v35.Y < -v21.Y and v41.ZIndex - 1 if not v49 then if v35.Y > v21.Y then v49 = v41.ZIndex + 1 else v49 = false end end v41.ZIndex = v49 v41.Rotation = math.deg(v46) + 180 v41.ImageColor3 = v37.Value ~= v8.Value and Color3.fromRGB(255, 50, 50) or (v34.Name == "Statue" and Color3.fromRGB(50, 200, 255) or Color3.fromRGB(50, 255, 50)) v41.Size = UDim2.new(v48, 0, v48, 0) v41.Position = UDim2.new(v39, 0, v40, 0) v41.Image = v34.Name == "Statue" and v7.Important or v7.Unit v41.Parent = v_u_2.UI.Detections end end end end v_u_3.RenderStepped:Wait() end
Assistant:
- Assistant
local localPlayer = game:GetService("Players").LocalPlayer local scriptParent = script.Parent local radar = scriptParent:WaitForChild("Radar") local runService = game:GetService("RunService") local tweenService = game:GetService("TweenService") game:GetService("ReplicatedStorage"):WaitForChild("Assets") game:GetService("ReplicatedStorage"):WaitForChild("Events") game:GetService("ReplicatedStorage"):WaitForChild("Modules")
local detectionRadius = 0 local detectedEntities = {} local assetIDs = { ["ImportantUnit"] = "rbxassetid://406047471", ["StructureUnit"] = "rbxassetid://3141874560", ["RegularUnit"] = "rbxassetid://402675744" }
-- Wait for the player character to be fully loaded repeat runService.RenderStepped:Wait() until localPlayer.Character.Parent and (localPlayer.Character:FindFirstChild("HumanoidRootPart") and localPlayer.Character.HumanoidRootPart.Parent)
localPlayer.Character:WaitForChild("Humanoid") local teamProperty = localPlayer.Character:WaitForChild("TEAM")
-- Coroutine to manage the radar sweeper animation coroutine.wrap(function() tweenService:Create(radar.Sweeper, TweenInfo.new(3, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, -1, true), { ["ImageTransparency"] = 0 }):Play() while true do local rotationTween = tweenService:Create(radar.Sweeper, TweenInfo.new(1.67, Enum.EasingStyle.Linear), { ["Rotation"] = 360 }) rotationTween:Play() rotationTween.Completed:Wait() radar.Sweeper.Rotation = 0 runService.RenderStepped:Wait() end end)()
-- Coroutine to manage the radar detector animation coroutine.wrap(function() while wait(3) do local detectorTween = tweenService local detectionUnit = radar.Detector local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Linear) local tweenProperties = { ["Size"] = UDim2.new(1, 0, 1, 0), ["ImageTransparency"] = 1 } local detectorTweenInstance = detectorTween:Create(detectionUnit, tweenInfo, tweenProperties) detectorTweenInstance:Play() detectorTweenInstance.Completed:Wait() radar.Detector.Size = UDim2.new(0, 0, 0, 0) radar.Detector.ImageTransparency = 0 end end)()
-- Function to detect nearby players local function detectNearbyEntities(area) local nextChild = next local childrenArray, childCount = area:GetChildren() for _, entity in nextChild, childrenArray, childCount do if entity:FindFirstChild("Humanoid") and (entity.Humanoid:GetState() ~= Enum.HumanoidStateType.Dead and (entity.Humanoid.Health > 0 and (entity:FindFirstChild("HumanoidRootPart") and (entity ~= localPlayer.Character and (Vector2.new(entity.HumanoidRootPart.CFrame.X, entity.HumanoidRootPart.CFrame.Z) - Vector2.new(localPlayer.Character.HumanoidRootPart.CFrame.X, localPlayer.Character.HumanoidRootPart.CFrame.Z)).Magnitude <= detectionRadius)))) then detectedEntities[#detectedEntities + 1] = { entity, entity.HumanoidRootPart.CFrame.p - localPlayer.Character.HumanoidRootPart.CFrame.p } end end end
while true do radar.UI.Detections:ClearAllChildren() if localPlayer.Character and (localPlayer.Character:FindFirstChild("HumanoidRootPart") and (localPlayer.Character:WaitForChild("Humanoid"):GetState() ~= Enum.HumanoidStateType.Dead and localPlayer.Character:WaitForChild("Humanoid").Health > 0)) then local modelSize = localPlayer.Character:GetModelSize() local lookVector = localPlayer.Character.HumanoidRootPart.CFrame.LookVector local cameraLookVector = workspace.CurrentCamera.CFrame.LookVector local zLook = lookVector.Z local xLook = lookVector.X local angle = math.atan2(zLook, xLook) local radarSize = (radar.AbsoluteSize.X + radar.AbsoluteSize.Y) * 0.75 + localPlayer.Character.HumanoidRootPart.CFrame.Y / (radar.AbsoluteSize.X + radar.AbsoluteSize.Y) radar.UI.Personnel.Rotation = math.deg(angle) + 180 local cameraZ = cameraLookVector.Z local cameraX = cameraLookVector.X local cameraAngle = math.atan2(cameraZ, cameraX) radar.UI.Rotation = -(math.deg(cameraAngle) - 90) local detectedUnits = {} detectNearbyEntities(workspace) detectNearbyEntities(workspace.Enemies)
if #detectedEntities > 0 then local detectionSize = radarSize for _, detected in next, detectedEntities do local detectedEntity = detected[1] local positionOffset = detected[2] local entityHumanoid = detectedEntity:FindFirstChild("Humanoid") local entityTeam = detectedEntity:FindFirstChild("TEAM") local entityRootPart = detectedEntity:FindFirstChild("HumanoidRootPart") local positionX = 0.5 + -positionOffset.X / detectionSize / 2 local positionY = 0.5 + -positionOffset.Z / detectionSize / 2 if entityHumanoid and (entityTeam and entityRootPart) then local unitMarker = script.RegularUnit:Clone() local size = detectedEntity:GetModelSize() local lookVector = entityRootPart.CFrame.lookVector local lookZ = lookVector.Z local lookX = lookVector.X local angle = math.atan2(lookZ, lookX) local normalizedSize = (size.X + size.Y + size.Z) / 375 local clampedSize = math.clamp(normalizedSize, 0.075, 0.2) local zIndexAdjustment if positionOffset.Y < -modelSize.Y then zIndexAdjustment = unitMarker.ZIndex - 1 elseif positionOffset.Y > modelSize.Y then zIndexAdjustment = unitMarker.ZIndex + 1 else zIndexAdjustment = false end unitMarker.ZIndex = zIndexAdjustment unitMarker.Rotation = math.deg(angle) + 180 unitMarker.ImageColor3 = entityTeam.Value ~= teamProperty.Value and Color3.fromRGB(255, 50, 50) or (detectedEntity.Name == "Statue" and Color3.fromRGB(50, 200, 255) or Color3.fromRGB(50, 255, 50)) unitMarker.Size = UDim2.new(clampedSize, 0, clampedSize, 0) unitMarker.Position = UDim2.new(positionX, 0, positionY, 0) unitMarker.Image = detectedEntity.Name == "Statue" and assetIDs.ImportantUnit or assetIDs.RegularUnit unitMarker.Parent = radar.UI.Detections end end end end runService.RenderStepped:Wait()end