System: 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 = script:WaitForChild("ScreenGui") script.Parent.Equipped:Connect(function() -- upvalues: (copy) v_u_1 v_u_1:Clone().Parent = game.Players.LocalPlayer.PlayerGui end) script.Parent.Unequipped:Connect(function() -- upvalues: (copy) v_u_1 game.Players.LocalPlayer.PlayerGui:FindFirstChild(v_u_1.Name):Destroy() end)
Assistant:
- Assistant
local screenGuiTemplate = script:WaitForChild("ScreenGui")
script.Parent.Equipped:Connect(function() -- Clone the ScreenGui template and set it as a child of the player's PlayerGui screenGuiTemplate:Clone().Parent = game.Players.LocalPlayer.PlayerGui end)
script.Parent.Unequipped:Connect(function() -- Find the cloned ScreenGui in the PlayerGui and destroy it local existingScreenGui = game.Players.LocalPlayer.PlayerGui:FindFirstChild(screenGuiTemplate.Name) if existingScreenGui then existingScreenGui:Destroy() end end)