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)
Your script is a decompiled Roblox Lua script, and it has several issues, including:
_ functions, which will overwrite each other)v_2, i_2, var73_upvw)PerformanceButton)Below is a cleaned-up and fixed version of your script.
Note: Some logic is guessed due to decompilation artifacts.
You may need to adjust some details to fit your actual game structure.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
if not game:IsLoaded() then
game.Loaded:Wait()
end
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Frames = LocalPlayer.PlayerGui:WaitForChild("Gui").Frames
local DailyRewards = Frames:WaitForChild("DailyRewards")
if not LocalPlayer.Character then
LocalPlayer.CharacterAdded:Wait()
end
task.wait(1)
local entries = {}
-- Utility: Add spaces between lowercase and uppercase letters
local function addSpaces(str)
return (str:gsub("(%l)(%u)", "%1 %2"))
end
-- Utility: Clear all entries
local function clearEntries()
for _, entry in ipairs(entries) do
entry.Visible = false
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(showOnFail)
local itemsFrame = DailyRewards.Background.ItemsFrame
local rewardsLoaded = LocalPlayer:GetAttribute("RewardsLoaded")
if not rewardsLoaded then
LocalPlayer:GetAttributeChangedSignal("RewardsLoaded"):Wait()
end
clearEntries()
local claimedCount = 0
local wins = LocalPlayer:GetAttribute("Wins") or 0
for day = 1, 7 do
local rewardStr = Data.DailyRewards.List:GetAttribute("Day"..day)
local claimed = Data.DailyRewards.Claimed:GetAttribute("Day"..day)
local rewardType, rewardValue, rewardExtra = table.unpack(string.split(rewardStr, '_'))
local entry = itemsFrame:FindFirstChild(tostring(day))
if not entry then
entry = itemsFrame.Parent:FindFirstChild(tostring(day))
end
if not entry then continue end
entry.Claimed.Visible = claimed
if claimed then claimedCount = claimedCount + 1 end
local rarity = "Common"
if day == 7 then
rarity = "Exclusive"
elseif day > 1 then
rarity = "Rare"
end
entry.Color.UIGradient.Color = Rarity:GetColor3(rarity)
entry.Frame.UIStroke.UIGradient.Color = Rarity:GetColor3(rarity)
entry.Header.Text = "Day "..day
-- Default: show cash
entry.Cash.Visible = true
if rewardType == "CashAndCrate" then
entry.Cash.Size = UDim2.fromScale(0.306, 0.274)
entry.Cash.Position = UDim2.fromScale(0.5, 0.3)
else
entry.Cash.Size = UDim2.fromScale(0.886, 0.405)
entry.Cash.Position = UDim2.fromScale(0.95, 0.45)
end
Tween:Play(entry.Frame.UIStroke.UIGradient, {
Rotation = 360;
}, {2, "Linear", "Out", -1, false, 0})
entry.ViewportFrame.Header.Visible = false
if rewardType == "CashAndCrate" then
local crateName = rewardValue
local crate = workspace:WaitForChild("Crates"):FindFirstChild(crateName) or workspace.Crates:WaitForChild(crateName)
entry.ViewportFrame.Header.Visible = true
entry.ViewportFrame.Header.Text = addSpaces(crate.Name)
entry.Cash.Image = "rbxassetid://90439079695119"
entry.Cash.Header.Text = "+"..tostring(rewardExtra).."$"
CreateViewport(entry.ViewportFrame, crate:Clone(), CFrame.fromOrientation(0.017, 0.017, 0.017))
elseif rewardType == "Crate" then
local crate = workspace:WaitForChild("Crates"):FindFirstChild(rewardValue) or workspace.Crates:WaitForChild(rewardValue)
entry.ViewportFrame.Header.Visible = true
entry.ViewportFrame.Header.Text = addSpaces(crate.Name)
CreateViewport(entry.ViewportFrame, crate:Clone(), CFrame.fromOrientation(0.017, 0.017, 0.017))
elseif rewardType == "Weapon" then
CreateViewport(entry.ViewportFrame, ReplicatedStorage.Weapons:WaitForChild(rewardValue):Clone())
elseif rewardType == "Cash" then
entry.Cash.Image = "rbxassetid://16538844651"
entry.Cash.Header.Text = "+"..tostring(rewardValue).."$"
elseif rewardType == "Potion" then
local potionImages = {
Damage = "rbxassetid://128221490064194";
Health = "rbxassetid://89538508721418";
Cash = "rbxassetid://87776945460045";
}
entry.Cash.Image = potionImages[rewardValue] or ""
entry.Cash.Header.Text = "+1"
end
entry.OP.Visible = true
-- Win progress bar
entry.WinFirst.Bar.Bar.Size = UDim2.fromScale(math.clamp(wins / 3, 0, 1), 1)
entry.WinFirst.Visible = true
-- Claim button logic
entry.Claim.Visible = true
entry.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)
entry.LayoutOrder = day
entry.Name = tostring(day)
entry.Visible = true
table.insert(entries, entry)
end
-- Update claimed text
local claimedText = string.format("<font color=\"rgb(255,0,0)\">%d</font>/7 Claimed", claimedCount)
DailyRewards.Background.Many.Text = claimedText
if claimedCount == 7 and showOnFail then
Frames.Visible = false
DailyRewards.Visible = false
end
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 PerformanceButton = require(ReplicatedStorage.Modules.Icon).new():align("Left"):setName("Daily Rewards"):setImage("rbxassetid://97824971258913")
PerformanceButton.toggled:Connect(function(isVisible)
Frames.Visible = isVisible
for _, v in ipairs(Frames:GetChildren()) do
v.Visible = (v.Name == "DailyRewards")
end
end)
LocalPlayer:GetAttributeChangedSignal("Wins"):Connect(function()
if LocalPlayer:GetAttribute("Wins") == 3 then
PerformanceButton:notify()
end
end)
Test this in a safe environment first!
If you have any specific errors or want to add more features, let me know!