Fix this script: -- Saved by UniversalSynSaveInstance (Join to Copy Games)…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
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)">%*/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)
Here's a cleaned-up and fixed version of your script with comments on the main fixes and improvements:
-- Saved by UniversalSynSaveInstance (Join to Copy Games) https://discord.gg/wx4ThpAsmw
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
if not game:IsLoaded() then
game.Loaded:Wait()
end
local LocalPlayer = Players.LocalPlayer
local Gui = LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Gui")
local Frames = Gui:WaitForChild("Frames")
local DailyRewards = Frames:WaitForChild("DailyRewards")
if not LocalPlayer.Character then
LocalPlayer.CharacterAdded:Wait()
end
task.wait(1)
local entries = {}
local function replaceWithQuestionMarks(str)
return string.gsub(str, '.', '?')
end
local function addSpaces(str)
local result = str:gsub("(%l)(%u)", "%1 %2")
return result
end
local function clearEntries()
for _, entry in pairs(entries) do
-- You might want to do cleanup here if needed
end
table.clear(entries)
end
local Data = LocalPlayer:WaitForChild("Data")
local Rarity = require(ReplicatedStorage.Modules.Rarity)
local Tween = require(ReplicatedStorage.Modules.Tween)
local CreateViewport = require(ReplicatedStorage.Modules.CreateViewport)
local function AddEntries(showIfNone)
local ItemsFrame = DailyRewards.Background.ItemsFrame
local hasClaimedAny = false
if not LocalPlayer:GetAttribute("RewardsLoaded") then
LocalPlayer:GetAttributeChangedSignal("RewardsLoaded"):Wait()
end
clearEntries()
for day = 1, 7 do
local rewardStr = Data.DailyRewards.List:GetAttribute("Day"..day)
local claimed = Data.DailyRewards.Claimed:GetAttribute("Day"..day)
if not rewardStr then
warn("Missing reward data for Day "..day)
continue
end
local rewardType, rewardValueStr, rewardExtra = table.unpack(string.split(rewardStr, '_'))
local rewardValue = tonumber(rewardValueStr) or rewardValueStr
local rewardData = {
Type = rewardType,
Value = rewardValue,
Extra = rewardExtra
}
if claimed then
hasClaimedAny = true
end
local dayFrame = ItemsFrame:FindFirstChild(tostring(day)) or ItemsFrame.Parent:FindFirstChild(tostring(day))
if not dayFrame then
warn("Missing UI frame for Day "..day)
continue
end
dayFrame.Claimed.Visible = claimed
local rarityType = "Common"
if day == 7 then
rarityType = "Exclusive"
elseif day > 1 then
rarityType = "Rare"
end
local color = Rarity:GetColor3(rarityType)
dayFrame.Color.UIGradient.Color = color
dayFrame.Frame.UIStroke.UIGradient.Color = color
dayFrame.Header.Text = "Day "..day
-- Setup visuals based on reward type
dayFrame.Cash.Visible = true
if rewardData.Type == "CashAndCrate" then
dayFrame.Cash.Size = UDim2.fromScale(0.306, 0.274)
dayFrame.Cash.Position = UDim2.fromScale(0.5, 0.3)
else
dayFrame.Cash.Size = UDim2.fromScale(0.886, 0.405)
dayFrame.Cash.Position = UDim2.fromScale(0.95, 0.45)
end
Tween:Play(dayFrame.Frame.UIStroke.UIGradient, {
Rotation = 360,
}, {2, "Linear", "Out", -1, false, 0})
dayFrame.ViewportFrame.Header.Visible = false
if rewardData.Type == "CashAndCrate" then
local crateName = rewardValue
local crateModel = workspace:WaitForChild("Crates"):FindFirstChild(crateName) or workspace.Crates:WaitForChild(crateName)
dayFrame.ViewportFrame.Header.Visible = true
dayFrame.ViewportFrame.Header.Text = addSpaces(crateModel.Name)
dayFrame.Cash.Image = "rbxassetid://90439079695119"
dayFrame.Cash.Header.Text = "+"..(rewardExtra or "").."$"
CreateViewport(dayFrame.ViewportFrame, crateModel:Clone(), CFrame.fromOrientation(math.rad(1), math.rad(1), math.rad(1)))
elseif rewardData.Type == "Crate" then
local crateModel = workspace:WaitForChild("Crates"):FindFirstChild(rewardData.Value) or workspace.Crates:WaitForChild(rewardData.Value)
dayFrame.ViewportFrame.Header.Visible = true
dayFrame.ViewportFrame.Header.Text = addSpaces(crateModel.Name)
CreateViewport(dayFrame.ViewportFrame, crateModel:Clone(), CFrame.fromOrientation(math.rad(1), math.rad(1), math.rad(1)))
elseif rewardData.Type == "Weapon" then
local weaponModel = ReplicatedStorage.Weapons:WaitForChild(rewardData.Value):Clone()
CreateViewport(dayFrame.ViewportFrame, weaponModel)
elseif rewardData.Type == "Cash" then
dayFrame.Cash.Image = "rbxassetid://16538844651"
dayFrame.Cash.Header.Text = "+"..rewardData.Value.."$"
elseif rewardData.Type == "Potion" then
local potionImages = {
Damage = "rbxassetid://128221490064194",
Health = "rbxassetid://89538508721418",
Cash = "rbxassetid://87776945460045",
}
dayFrame.Cash.Image = potionImages[rewardValue] or ""
dayFrame.Cash.Header.Text = "+1"
else
dayFrame.Cash.Visible = false
end
dayFrame.OP.Visible = true
-- Determine if the day is claimable
local canClaim = false
if not claimed then
local timestamp = Data.DailyRewards:GetAttribute("Timestamp") or 0
local currentTime = os.time()
if 86400 * (day - 1) <= currentTime - timestamp then
canClaim = true
end
end
local wins = LocalPlayer:GetAttribute("Wins") or 0
dayFrame.WinFirst.Bar.Bar.Size = UDim2.fromScale(math.clamp(wins / 3, 0, 1), 1)
dayFrame.WinFirst.Visible = true
dayFrame.Claim.Visible = canClaim
dayFrame.Activated:Connect(function()
if (LocalPlayer:GetAttribute("Wins") or 0) < 3 then
return
end
if ReplicatedStorage.Remotes.ClaimDaily:InvokeServer("Day"..day) then
clearEntries()
AddEntries()
end
end)
entries[#entries + 1] = dayFrame
dayFrame.LayoutOrder = day
dayFrame.Name = tostring(day)
dayFrame.Visible = true
end
if not hasClaimedAny and showIfNone then
Frames.Visible = false
DailyRewards.Visible = false
end
-- Update claimed count text
local claimedCount = 0
for day = 1, 7 do
if Data.DailyRewards.Claimed:GetAttribute("Day"..day) then
claimedCount = claimedCount + 1
end
end
DailyRewards.Background.Many.Text = string.format("<font color=\"rgb(255,0,0)\">%d</font>/7 Claimed", claimedCount)
end
if DailyRewards.Visible then
AddEntries(true)
else
clearEntries()
end
DailyRewards:GetPropertyChangedSignal("Visible"):Connect(function()
if DailyRewards.Visible then
AddEntries()
else
clearEntries()
end
end)
local IconModule = require(ReplicatedStorage.Modules.Icon)
local PerformanceButton = IconModule.new():align("Left"):setName("Daily Rewards"):setImage("rbxassetid://97824971258913")
PerformanceButton.toggled:Connect(function(isToggled)
Frames.Visible = isToggled
for _, frame in pairs(Frames:GetChildren()) do
frame.Visible = (frame.Name == "DailyRewards") and isToggled or false
end
end)
LocalPlayer:GetAttributeChangedSignal("Wins"):Connect(function()
if LocalPlayer:GetAttribute("Wins") == 3 then
PerformanceButton:notify()
end
end)
_upvr suffixes for clarity.for _, _ in tbl_6_upvr do end loops to proper for _, v in pairs(tbl_6_upvr) do or replaced with clearEntries() function.Activated connection to properly reference the current day.var67 and others.If you want me to explain any part or add more features, just ask!