Fix this script:
-- Saved by UniversalSynSaveInstance (Join to Copy Games) https://discord.gg/wx4ThpAsmw

-- Decompiler will be improved VERY SOON!
-- Decompiled with Konstant V2.1, a fast Luau decompiler made in Luau by plusgiant5 (https://discord.gg/brNTY8nX8t)
-- Decompiled on 2025-07-13 01:08:36
-- Luau version 6, Types version 3
-- Time taken: 0.020797 seconds

local ReplicatedStorage_upvr = game:GetService("ReplicatedStorage")
if not game:IsLoaded() then
	game.Loaded:Wait()
end
local LocalPlayer_upvr = game:GetService("Players").LocalPlayer
local Frames_upvr = LocalPlayer_upvr.PlayerGui:WaitForChild("Gui").Frames
local DailyRewards_upvr = Frames_upvr:WaitForChild("DailyRewards")
if not LocalPlayer_upvr.Character then
	LocalPlayer_upvr.CharacterAdded:Wait()
end
task.wait(1)
local tbl_6_upvr = {}
local function _(arg1) -- Line 31, Named "replaceWithQuestionMarks"
	return string.gsub(arg1, '.', '?')
end
local function _(arg1) -- Line 36, Named "AddSpaces"
	local any_gsub_result1_5, _ = arg1:gsub("(%l)(%u)", "%1 %2")
	return any_gsub_result1_5
end
local function _() -- Line 41, Named "ClearEntries"
	--[[ Upvalues[1]:
		[1]: tbl_6_upvr (readonly)
	]]
	for _, _ in tbl_6_upvr do
	end
	table.clear(tbl_6_upvr)
end
local Data_upvr = LocalPlayer_upvr:WaitForChild("Data")
local Rarity_upvr = require(ReplicatedStorage_upvr.Modules.Rarity)
local Tween_upvr = require(ReplicatedStorage_upvr.Modules.Tween)
local CreateViewport_upvr = require(ReplicatedStorage_upvr.Modules.CreateViewport)
local function AddEntries_upvr(arg1) -- Line 49, Named "AddEntries"
	--[[ Upvalues[10]:
		[1]: DailyRewards_upvr (readonly)
		[2]: LocalPlayer_upvr (readonly)
		[3]: tbl_6_upvr (readonly)
		[4]: Data_upvr (readonly)
		[5]: Rarity_upvr (readonly)
		[6]: Tween_upvr (readonly)
		[7]: CreateViewport_upvr (readonly)
		[8]: ReplicatedStorage_upvr (readonly)
		[9]: AddEntries_upvr (readonly)
		[10]: Frames_upvr (readonly)
	]]
	-- KONSTANTWARNING: Variable analysis failed. Output will have some incorrect variable assignments
	local _ = DailyRewards_upvr.Background.ItemsFrame
	local var67
	if not LocalPlayer_upvr:GetAttribute("RewardsLoaded") then
		LocalPlayer_upvr:GetAttributeChangedSignal("RewardsLoaded"):Wait()
	end
	for i_2, v_2 in tbl_6_upvr do
	end
	table.clear(tbl_6_upvr)
	for i_3 = 1, 7 do
		v_2 = Data_upvr.DailyRewards
		i_2 = v_2.List:GetAttribute("Day"..i_3)
		v_2 = Data_upvr.DailyRewards.Claimed:GetAttribute("Day"..i_3)
		local unpacked_value_1, unpacked_value_2_2, unpacked_value_3 = table.unpack(string.split(i_2, '_'))
		local var71
		if tonumber(unpacked_value_2_2) then
			var71 = unpacked_value_2_2
			unpacked_value_2_2 = tonumber(var71)
		end
		local tbl_3 = {
			Type = unpacked_value_1;
			Value = unpacked_value_2_2;
		}
		if v_2 then
			local var73_upvw = 0 + 1
		end
		var71 = _:FindFirstChild(tostring(i_3))
		if not var71 then
			var71 = _.Parent:FindFirstChild(tostring(i_3))
		end
		var71.Claimed.Visible = v_2
		local var74 = "Common"
		if i_3 == 7 then
			var74 = "Exclusive"
		elseif 1 < i_3 then
			var74 = "Rare"
		end
		var71.Color.UIGradient.Color = Rarity_upvr:GetColor3(var74)
		var71.Frame.UIStroke.UIGradient.Color = Rarity_upvr:GetColor3(var74)
		var71.Header.Text = "Day "..i_3
		if tbl_3.Type ~= "Cash" then
			if tbl_3.Type ~= "CashAndCrate" then
				if tbl_3.Type ~= "Potion" then
				else
				end
			end
		end
		var71.Cash.Visible = true
		if tbl_3.Type == "CashAndCrate" then
			var71.Cash.Size = UDim2.fromScale(0.306, 0.274)
			var71.Cash.Position = UDim2.fromScale(0.5, 0.3)
		else
			var71.Cash.Size = UDim2.fromScale(0.886, 0.405)
			var71.Cash.Position = UDim2.fromScale(0.95, 0.45)
		end
		Tween_upvr:Play(var71.Frame.UIStroke.UIGradient, {
			Rotation = 360;
		}, {2, "Linear", "Out", -1, false, 0})
		var71.ViewportFrame.Header.Visible = false
		if tbl_3.Type == "CashAndCrate" then
			local var77 = unpacked_value_2_2
			local SOME_4 = workspace:WaitForChild("Crates"):FindFirstChild(var77)
			if not SOME_4 then
				SOME_4 = workspace.Crates:WaitForChild(var77)
			end
			var71.ViewportFrame.Header.Visible = true
			local any_gsub_result1, _ = SOME_4.Name:gsub("(%l)(%u)", "%1 %2")
			var71.ViewportFrame.Header.Text = any_gsub_result1
			var71.Cash.Image = "rbxassetid://90439079695119"
			var71.Cash.Header.Text = `+{unpacked_value_3}$`
			CreateViewport_upvr(var71.ViewportFrame, SOME_4:Clone(), CFrame.fromOrientation(0.017453292519943295, 0.017453292519943295, 0.017453292519943295))
		elseif tbl_3.Type == "Crate" then
			local SOME_2 = workspace:WaitForChild("Crates"):FindFirstChild(tbl_3.Value)
			if not SOME_2 then
				SOME_2 = workspace.Crates:WaitForChild(tbl_3.Value)
			end
			var71.ViewportFrame.Header.Visible = true
			local any_gsub_result1_4, _ = SOME_2.Name:gsub("(%l)(%u)", "%1 %2")
			var71.ViewportFrame.Header.Text = any_gsub_result1_4
			CreateViewport_upvr(var71.ViewportFrame, SOME_2:Clone(), CFrame.fromOrientation(0.017453292519943295, 0.017453292519943295, 0.017453292519943295))
		elseif tbl_3.Type == "Weapon" then
			CreateViewport_upvr(var71.ViewportFrame, ReplicatedStorage_upvr.Weapons:WaitForChild(tbl_3.Value):Clone())
		elseif tbl_3.Type == "Cash" then
			var71.Cash.Image = "rbxassetid://16538844651"
			var71.Cash.Header.Text = `+{tbl_3.Value}$`
		elseif tbl_3.Type == "Potion" then
			var71.Cash.Image = ({
				Damage = "rbxassetid://128221490064194";
				Health = "rbxassetid://89538508721418";
				Cash = "rbxassetid://87776945460045";
			})[unpacked_value_2_2]
			var71.Cash.Header.Text = "+1"
		end
		if var74 ~= "Exclusive" then
		else
		end
		var71.OP.Visible = true
		if not var67 then
			if not v_2 then
				if 86400 * (i_3 - 1) > os.time() - Data_upvr.DailyRewards:GetAttribute("Timestamp") then
					local _ = false
					-- KONSTANTWARNING: Skipped task `defvar` above
				else
				end
			end
		end
		local var86 = LocalPlayer_upvr:GetAttribute("Wins") or 0
		var71.WinFirst.Bar.Bar.Size = UDim2.fromScale(var86 / 3, 1)
		if true then
			if var86 >= 3 then
			else
			end
		end
		var71.WinFirst.Visible = true
		-- KONSTANTERROR: Expression was reused, decompilation is incorrect
		if true then
			if 2 >= var86 then
			else
			end
		end
		var71.Claim.Visible = true
		var71.Activated:Connect(function() -- Line 139
			--[[ Upvalues[5]:
				[1]: LocalPlayer_upvr (copied, readonly)
				[2]: ReplicatedStorage_upvr (copied, readonly)
				[3]: var73_upvw (read and write)
				[4]: tbl_6_upvr (copied, readonly)
				[5]: AddEntries_upvr (copied, readonly)
			]]
			if not LocalPlayer_upvr:GetAttribute("Wins") or LocalPlayer_upvr:GetAttribute("Wins") < 3 then
			elseif ReplicatedStorage_upvr.Remotes.ClaimDaily:InvokeServer("Day"..(var73_upvw + 1)) then
				for _, _ in tbl_6_upvr do
				end
				table.clear(tbl_6_upvr)
				AddEntries_upvr()
			end
		end)
		-- KONSTANTERROR: Expression was reused, decompilation is incorrect
		if true then
			var67 = true
		end
		if not _G.NotCompleteDaily then
			_G.NotCompleteDaily = var71.WinFirst.Visible
		elseif not LocalPlayer_upvr:GetAttribute("Wins") then
			LocalPlayer_upvr:SetAttribute("Wins", 0)
		end
		var71.LayoutOrder = i_3
		var71.Name = i_3
		var71.Visible = true
		table.insert(tbl_6_upvr, var71)
	end
	if not var67 and arg1 then
		Frames_upvr.Visible = false
		DailyRewards_upvr.Visible = false
	end
	i_3 = DailyRewards_upvr
	i_3 = "<font color=\"rgb(255,0,0)\">%*</font>/7 Claimed"
	v_2 = var73_upvw
	i_3 = i_3:format(v_2)
	i_3.Background.Many.Text = i_3
end
if DailyRewards_upvr.Visible then
	AddEntries_upvr(true)
else
	for _, _ in tbl_6_upvr do
	end
	table.clear(tbl_6_upvr)
end
DailyRewards_upvr:GetPropertyChangedSignal("Visible"):Connect(function() -- Line 180
	--[[ Upvalues[3]:
		[1]: DailyRewards_upvr (readonly)
		[2]: AddEntries_upvr (readonly)
		[3]: tbl_6_upvr (readonly)
	]]
	if DailyRewards_upvr.Visible then
		AddEntries_upvr()
	else
		for _, _ in tbl_6_upvr do
		end
		table.clear(tbl_6_upvr)
	end
end)
PerformanceButton = require(ReplicatedStorage_upvr.Modules.Icon).new():align("Left"):setName("Daily Rewards"):setImage("rbxassetid://97824971258913") -- Setting global
PerformanceButton.toggled:Connect(function(arg1, arg2) -- Line 195
	--[[ Upvalues[1]:
		[1]: Frames_upvr (readonly)
	]]
	Frames_upvr.Visible = arg1
	for _, v_4 in Frames_upvr:GetChildren() do
		local var101
		if v_4.Name ~= "DailyRewards" then
			var101 = false
		else
			var101 = true
		end
		v_4.Visible = var101
	end
end)
LocalPlayer_upvr:GetAttributeChangedSignal("Wins"):Connect(function() -- Line 202
	--[[ Upvalues[1]:
		[1]: LocalPlayer_upvr (readonly)
	]]
	if LocalPlayer_upvr:GetAttribute("Wins") == 3 then
		PerformanceButton:notify()
	end
end)