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: -- Decompiler will be improved soon! -- Decompiled with Konstant V2.1, a fast Luau decompiler made in Luau by plusgiant5 (https://discord.gg/wyButjTMhM) -- Decompiled on 2025-02-01 06:25:21 -- Luau version 6, Types version 3 -- Time taken: 0.002483 seconds
local TweenService_upvr = game:GetService("TweenService") local TweenInfo_new_result1_upvr = TweenInfo.new(0.5, Enum.EasingStyle.Linear) local UiPositions_upvr = require(script.UiPositions) local LocalPlayer = game.Players.LocalPlayer local Gui_upvr = LocalPlayer.PlayerGui:WaitForChild("Gui") local Shop_upvr = Gui_upvr.Shop local Servers_upvr = Gui_upvr.Servers local Main_upvr = Gui_upvr.Main local Help_upvr = Gui_upvr.Help LocalPlayer.Information:WaitForChild("Credits") Main_upvr.PlayerStats.Credits.Text = LocalPlayer.Information.Credits.Value Main_upvr.PlayerStats.Losses.Text = LocalPlayer.Information.Losses.Value Main_upvr.PlayerStats.Wins.Text = LocalPlayer.Information.Wins.Value Shop_upvr.Towers.PlayerStats.Credits.Text = LocalPlayer.Information.Credits.Value Shop_upvr.Towers.PlayerStats.Losses.Text = LocalPlayer.Information.Losses.Value Shop_upvr.Towers.PlayerStats.Wins.Text = LocalPlayer.Information.Wins.Value LocalPlayer.Information.Credits.Changed:Connect(function(arg1) -- Line 21 --[[ Upvalues[2]: [1]: Shop_upvr (readonly) [2]: Main_upvr (readonly) ]] Shop_upvr.Towers.PlayerStats.Credits.Text = arg1 Main_upvr.PlayerStats.Credits.Text = arg1 end) LocalPlayer.Information.Losses.Changed:Connect(function(arg1) -- Line 26 --[[ Upvalues[2]: [1]: Shop_upvr (readonly) [2]: Main_upvr (readonly) ]] Shop_upvr.Towers.PlayerStats.Losses.Text = arg1 Main_upvr.PlayerStats.Losses.Text = arg1 end) LocalPlayer.Information.Wins.Changed:Connect(function(arg1) -- Line 31 --[[ Upvalues[2]: [1]: Main_upvr (readonly) [2]: Shop_upvr (readonly) ]] Main_upvr.PlayerStats.Wins.Text = arg1 Shop_upvr.Towers.PlayerStats.Wins.Text = arg1 end) Main_upvr.Buttons.Servers.Activated:Connect(function() -- Line 36 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Servers_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Servers.Main; }):Play() TweenService_upvr:Create(Servers_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Servers.Servers; }):Play() end) Servers_upvr.Servers.Back.Activated:Connect(function() -- Line 44 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Servers_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Servers.Back.Main; }):Play() TweenService_upvr:Create(Servers_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Servers.Back.Servers; }):Play() end) Main_upvr.Buttons.Towers.Activated:Connect(function() -- Line 52 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Shop_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Towers.Main; }):Play() TweenService_upvr:Create(Shop_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Towers.Towers; }):Play() end) Shop_upvr.Towers.Back.Activated:Connect(function() -- Line 60 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Shop_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Towers.Back.Main; }):Play() TweenService_upvr:Create(Shop_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Towers.Back.Towers; }):Play() end) Main_upvr.Buttons.Help.Activated:Connect(function() -- Line 68 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Help_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Help.Main; }):Play() TweenService_upvr:Create(Help_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Help.Help; }):Play() end) Help_upvr.Help.Back.Activated:Connect(function() -- Line 76 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Help_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Help.Back.Main; }):Play() TweenService_upvr:Create(Help_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Help.Back.Help; }):Play() end) Main_upvr.Admin.Activated:Connect(function() -- Line 84 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Gui_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Panel.Main; }):Play() TweenService_upvr:Create(Gui_upvr.AdminPanel, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Panel.Panel; }):Play() end) Gui_upvr.AdminPanel.Back.Activated:Connect(function() -- Line 92 --[[ Upvalues[5]: [1]: TweenService_upvr (readonly) [2]: Main_upvr (readonly) [3]: TweenInfo_new_result1_upvr (readonly) [4]: UiPositions_upvr (readonly) [5]: Gui_upvr (readonly) ]] TweenService_upvr:Create(Main_upvr, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Panel.Back.Main; }):Play() TweenService_upvr:Create(Gui_upvr.AdminPanel, TweenInfo_new_result1_upvr, { Position = UiPositions_upvr.Panel.Back.Panel; }):Play() end) Assistant:
- Assistant
local TweenService = game:GetService("TweenService") local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
-- Load UI position configurations local uiPositions = require(script.UiPositions)
-- Get local player's GUI and relevant components local localPlayer = game.Players.LocalPlayer local playerGui = localPlayer.PlayerGui:WaitForChild("Gui") local shopGui = playerGui.Shop local serversGui = playerGui.Servers local mainGui = playerGui.Main local helpGui = playerGui.Help
-- Ensure player's information is ready for display localPlayer.Information:WaitForChild("Credits")
-- Initialize UI with player's current statistics mainGui.PlayerStats.Credits.Text = localPlayer.Information.Credits.Value mainGui.PlayerStats.Losses.Text = localPlayer.Information.Losses.Value mainGui.PlayerStats.Wins.Text = localPlayer.Information.Wins.Value
shopGui.Towers.PlayerStats.Credits.Text = localPlayer.Information.Credits.Value shopGui.Towers.PlayerStats.Losses.Text = localPlayer.Information.Losses.Value shopGui.Towers.PlayerStats.Wins.Text = localPlayer.Information.Wins.Value
-- Update the UI when the player's credits change localPlayer.Information.Credits.Changed:Connect(function(newCredits) shopGui.Towers.PlayerStats.Credits.Text = newCredits mainGui.PlayerStats.Credits.Text = newCredits end)
-- Update the UI when the player's losses change localPlayer.Information.Losses.Changed:Connect(function(newLosses) shopGui.Towers.PlayerStats.Losses.Text = newLosses mainGui.PlayerStats.Losses.Text = newLosses end)
-- Update the UI when the player's wins change localPlayer.Information.Wins.Changed:Connect(function(newWins) mainGui.PlayerStats.Wins.Text = newWins shopGui.Towers.PlayerStats.Wins.Text = newWins end)
-- Navigate to the servers UI when the server button is clicked mainGui.Buttons.Servers.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Servers.Main }):Play() TweenService:Create(serversGui, tweenInfo, { Position = uiPositions.Servers.Servers }):Play() end)
-- Go back to main UI from the servers UI serversGui.Servers.Back.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Servers.Back.Main }):Play() TweenService:Create(serversGui, tweenInfo, { Position = uiPositions.Servers.Back.Servers }):Play() end)
-- Navigate to the towers UI when the towers button is clicked mainGui.Buttons.Towers.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Towers.Main }):Play() TweenService:Create(shopGui, tweenInfo, { Position = uiPositions.Towers.Towers }):Play() end)
-- Go back to main UI from the towers UI shopGui.Towers.Back.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Towers.Back.Main }):Play() TweenService:Create(shopGui, tweenInfo, { Position = uiPositions.Towers.Back.Towers }):Play() end)
-- Navigate to the help UI when the help button is clicked mainGui.Buttons.Help.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Help.Main }):Play() TweenService:Create(helpGui, tweenInfo, { Position = uiPositions.Help.Help }):Play() end)
-- Go back to main UI from the help UI helpGui.Help.Back.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Help.Back.Main }):Play() TweenService:Create(helpGui, tweenInfo, { Position = uiPositions.Help.Back.Help }):Play() end)
-- Navigate to the admin panel when the admin button is clicked mainGui.Admin.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Panel.Main }):Play() TweenService:Create(playerGui.AdminPanel, tweenInfo, { Position = uiPositions.Panel.Panel }):Play() end)
-- Go back to main UI from the admin panel playerGui.AdminPanel.Back.Activated:Connect(function() TweenService:Create(mainGui, tweenInfo, { Position = uiPositions.Panel.Back.Main }):Play() TweenService:Create(playerGui.AdminPanel, tweenInfo, { Position = uiPositions.Panel.Back.Panel }):Play() end)