Assistant: 
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 Konstant V2.1, a fast Luau decompiler made in Luau by plusgiant5 (https://discord.gg/wyButjTMhM)
-- Decompiled on 2024-10-04 23:10:29
-- Luau version 6, Types version 3
-- Time taken: 0.003220 seconds

local Frame_upvr = script.Parent:WaitForChild("Frame")
local CloseGui_upvr = Frame_upvr:WaitForChild("CloseGui")
script.Parent:WaitForChild("Frame"):WaitForChild("TextButton").MouseButton1Click:Connect(function() -- Line 11
	--[[ Upvalues[2]:
		[1]: CloseGui_upvr (readonly)
		[2]: Frame_upvr (readonly)
	]]
	CloseGui_upvr:Play()
	Frame_upvr.Visible = false
end)
local function _(arg1) -- Line 16, Named "SecondsToMinutes"
	local var4 = arg1
	local var5 = arg1 / 60 % 60
	local var6
	if 1 <= var5 then
		var6 = 60
		var4 -= var6 * math.floor(var5)
	end
	local function INLINED() -- Internal function, doesn't exist in bytecode
		var6 = "%sm ":format(math.floor(var5))
		return var6
	end
	if 1 > var5 or not INLINED() then
		var6 = ""
	end
	return var6.."%ss":format(math.floor(var4))
end
local var7_upvw = 0
local var8_upvw = false
local Timer_upvr = script.Parent:WaitForChild("Timer")
local function StartTimer_upvr() -- Line 30, Named "StartTimer"
	--[[ Upvalues[3]:
		[1]: var8_upvw (read and write)
		[2]: Timer_upvr (readonly)
		[3]: var7_upvw (read and write)
	]]
	var8_upvw = true
	Timer_upvr.Visible = true
	for i = 540, 1, -1 do
		local var12
		if 0 >= var7_upvw or tick() - var7_upvw <= 4 then break end
		local var13 = i
		var12 = i / 60
		local var14 = var12 % 60
		var12 = 1
		if var12 <= var14 then
			var12 = 60 * math.floor(var14)
			var13 -= var12
		end
		local function INLINED_2() -- Internal function, doesn't exist in bytecode
			var12 = "%sm ":format(math.floor(var14))
			return var12
		end
		if 1 > var14 or not INLINED_2() then
			var12 = ""
		end
		Timer_upvr.Text = "Rent Timer: %s":format(var12.."%ss":format(math.floor(var13)))
		task.wait(1)
	end
	Timer_upvr.Text = "Timer Ended"
	task.wait(0)
	var7_upvw = 0
	var8_upvw = false
	Timer_upvr.Visible = false
end
local Gui_Pop_Up_Sound_upvr = Frame_upvr:WaitForChild("Gui Pop Up Sound")
local KickedFrmHouse_upvr = script.Parent:WaitForChild("KickedFrmHouse")
local KickedFrmHouseSound_upvr = Frame_upvr:WaitForChild("KickedFrmHouseSound")
local PaidRent_upvr = script.Parent:WaitForChild("PaidRent")
game:GetService("ReplicatedStorage"):WaitForChild("RentRemote").OnClientInvoke = function(arg1) -- Line 50
	--[[ Upvalues[8]:
		[1]: Frame_upvr (readonly)
		[2]: StartTimer_upvr (readonly)
		[3]: Gui_Pop_Up_Sound_upvr (readonly)
		[4]: CloseGui_upvr (readonly)
		[5]: KickedFrmHouse_upvr (readonly)
		[6]: var7_upvw (read and write)
		[7]: KickedFrmHouseSound_upvr (readonly)
		[8]: PaidRent_upvr (readonly)
	]]
	if arg1 == "Popup" then
		if Frame_upvr.Visible then
		else
			coroutine.wrap(StartTimer_upvr)()
			Gui_Pop_Up_Sound_upvr:Play()
			Frame_upvr.Visible = true
			task.delay(8, function() -- Line 61
				--[[ Upvalues[2]:
					[1]: Frame_upvr (copied, readonly)
					[2]: CloseGui_upvr (copied, readonly)
				]]
				if Frame_upvr.Visible then
					CloseGui_upvr:Play()
					Frame_upvr.Visible = false
				end
			end)
		end
	end
	if arg1 == "Kick" then
		if KickedFrmHouse_upvr.Visible then
		else
			var7_upvw = tick()
			KickedFrmHouseSound_upvr:Play()
			KickedFrmHouse_upvr.Visible = true
			task.delay(3, function() -- Line 76
				--[[ Upvalues[1]:
					[1]: KickedFrmHouse_upvr (copied, readonly)
				]]
				KickedFrmHouse_upvr.Visible = false
			end)
		end
	end
	if arg1 == "Paid" then
		if PaidRent_upvr.Visible then return end
		var7_upvw = tick()
		CloseGui_upvr:Play()
		PaidRent_upvr.Visible = true
		task.delay(3, function() -- Line 88
			--[[ Upvalues[1]:
				[1]: PaidRent_upvr (copied, readonly)
			]]
			PaidRent_upvr.Visible = false
		end)
	end
end
Assistant:
Assistant: