Yesterday everything worked perfectly fine,but now,the ‘RESET’ gui won’t even open and the ‘RESETBUTTON’ may not even be visible.Here is the code:
local Settings = require(game.ReplicatedStorage.Modules.Settings)
if game.Players.LocalPlayer:FindFirstChild("_loadeddata") and game.Players.LocalPlayer.LOVE.Value >= Settings.MaxLOVE or game.Players.LocalPlayer.LOVE.Value == 100 and game.Players.LocalPlayer.Resets.Value < Settings.MaxResets then
script.Parent.Enabled = true
debounce = false
if game.Players.LocalPlayer.Resets.Value < Settings.MaxResets then
script.Parent.Reset.Boost.Text = "Current Boost : "..tostring((game.Players.LocalPlayer.Resets.Value)+1).."x Gold"
if game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)) then
script.Parent.Reset.Reset.Text = "Reset"
script.Parent.Reset.Fought.Visible = true
if game.Players.LocalPlayer.BossChart:FindFirstChild(game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)).Value.Name).TimesFought.Value >= 1 then
script.Parent.Reset.Fought.Text = "You have fought "..game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)).Value.BattleName.Value.." so you can proceed to reset for free"
else
script.Parent.Reset.Fought.Text = "You haven't fought "..game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)).Value.BattleName.Value.." solo so you can't proceed to reset"
end
else
if Settings.ResetPriceBase*(game.Players.LocalPlayer.Resets.Value+1) < 1000000 then
script.Parent.Reset.Fought.Visible = false
script.Parent.Reset.Reset.Text = "Reset for "..tostring((Settings.ResetPriceBase*(game.Players.LocalPlayer.Resets.Value+1))/1000).."K Gold"
else
script.Parent.Reset.Reset.Text = "Reset for "..tostring((Settings.ResetPriceBase*(game.Players.LocalPlayer.Resets.Value+1))/1000000).."M Gold"
end
end
local OpenCD = false
script.Parent.ResetButton.MouseButton1Click:Connect(function()
if OpenCD == false then
if script.Parent.Reset.Visible == true then
OpenCD = true
game.TweenService:Create(script.Parent.Reset, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut),{Size = UDim2.new(0, 0, 0, 0),Position = UDim2.new(0.5, 0,-1, 0)}):Play()
wait(1.1)
OpenCD = false
script.Parent.Reset.Visible = false
elseif script.Parent.Reset.Visible == false then
OpenCD = true
script.Parent.Reset.Visible = true
game.TweenService:Create(script.Parent.Reset, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut),{Size = UDim2.new(0.5, 0, 0.5, 0),Position = UDim2.new(0.25, 0, 0.25, 0)}):Play()
wait(1.1)
OpenCD = false
end
end
end)
script.Parent.Reset.Reset.MouseButton1Click:Connect(function()
if debounce == false then
debounce = true
game.Lighting.Reset:FireServer()
script.Parent.Reset.Visible = false
wait(10)
debounce = false
end
end)
else
script.Parent.Reset.Reset.Visible = false
script.Parent.Reset.Boost.Visible = false
script.Parent.Reset.TextLabel.Visible = false
script.Parent.Reset.Max.Visible = true
script.Parent.ResetButton.MouseButton1Click:Connect(function()
script.Parent.Reset.Visible = not script.Parent.Reset.Visible
end)
end
end
game.Lighting.Music.OnClientEvent:Connect(function()
script.Parent.Enabled = false
end)
2 Likes
CDFII4
(CDFII)
February 25, 2025, 9:09am
#2
I recommend first of cleaning up the code and using variables, since you’ll get lost pretty easily with alot of script.Parent.Parent.Parent
…, you also have some gui instance’s named exactly the same in some cases
This is also hard to rake up, since you don’t have anything documented (comments or well named variables) and there’s alot of if/else
checks.
Try using print
function after each if/else
and check where it’s going wrong. Also compare your previously working code to current and check what changed.
local Settings = require(game.ReplicatedStorage.Modules.Settings)
if game.Players.LocalPlayer:FindFirstChild("_loadeddata") and game.Players.LocalPlayer.LOVE.Value >= Settings.MaxLOVE or game.Players.LocalPlayer.LOVE.Value == 100 and game.Players.LocalPlayer.Resets.Value < Settings.MaxResets then
print("e")
script.Parent.Enabled = true
debounce = false
if game.Players.LocalPlayer.Resets.Value < 20 then
print("eq")
script.Parent.Reset.Boost.Text = "Current Boost : "..tostring((game.Players.LocalPlayer.Resets.Value)+1).."x Gold"
if game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)) then
print("eqq")
script.Parent.Reset.Reset.Text = "Reset"
script.Parent.Reset.Fought.Visible = true
if game.Players.LocalPlayer.BossChart:FindFirstChild(game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)).Value.Name).TimesFought.Value >= 1 then
print("eqqw")
script.Parent.Reset.Fought.Text = "You have fought "..game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)).Value.BattleName.Value.." so you can proceed to reset for free"
else
print("eqqwr")
script.Parent.Reset.Fought.Text = "You haven't fought "..game.Lighting.FinalBosses:FindFirstChild(tostring(game.Players.LocalPlayer.Resets.Value)).Value.BattleName.Value.." solo so you can't proceed to reset"
end
else
if Settings.ResetPriceBase*(game.Players.LocalPlayer.Resets.Value+1) < 1000000 then
print("eqqwrt")
script.Parent.Reset.Fought.Visible = false
script.Parent.Reset.Reset.Text = "Reset for "..tostring((Settings.ResetPriceBase*(game.Players.LocalPlayer.Resets.Value+1))/1000).."K Gold"
else
print("eqqwrty")
script.Parent.Reset.Reset.Text = "Reset for "..tostring((Settings.ResetPriceBase*(game.Players.LocalPlayer.Resets.Value+1))/1000000).."M Gold"
end
end
local OpenCD = false
script.Parent.ResetButton.MouseButton1Click:Connect(function()
if OpenCD == false then
print("eqqwrtyt")
if script.Parent.Reset.Visible == true then
OpenCD = true
game.TweenService:Create(script.Parent.Reset, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut),{Size = UDim2.new(0, 0, 0, 0),Position = UDim2.new(0.5, 0,-1, 0)}):Play()
wait(1.1)
OpenCD = false
script.Parent.Reset.Visible = false
elseif script.Parent.Reset.Visible == false then
print("eqqwrtytr")
OpenCD = true
script.Parent.Reset.Visible = true
game.TweenService:Create(script.Parent.Reset, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut),{Size = UDim2.new(0.5, 0, 0.5, 0),Position = UDim2.new(0.25, 0, 0.25, 0)}):Play()
wait(1.1)
OpenCD = false
end
end
end)
script.Parent.Reset.Reset.MouseButton1Click:Connect(function()
if debounce == false then
print("eqqwrtytrg")
debounce = true
game.Lighting.Reset:FireServer()
script.Parent.Reset.Visible = false
wait(10)
debounce = false
end
end)
else
script.Parent.Reset.Reset.Visible = false
script.Parent.Reset.Boost.Visible = false
script.Parent.Reset.TextLabel.Visible = false
script.Parent.Reset.Max.Visible = true
script.Parent.ResetButton.MouseButton1Click:Connect(function()
script.Parent.Reset.Visible = not script.Parent.Reset.Visible
end)
end
end
game.Lighting.Music.OnClientEvent:Connect(function()
script.Parent.Enabled = false
end)
it appears,that only the first print “e” is getting printed,also,i didnt change the script since it has been broken
I cant really read the code well as it is quite spaghetti but it seems from your previous comment that resets.value isnt < 20 so it doesnt want to run so quick question where does that value come from?
settings.maxresets and 20 resets have the same value of 20
huh? do you mean if its under or matches 20, if so change
if game.Players.LocalPlayer.Resets.Value < 20 then
to if game.Players.LocalPlayer.Resets.Value <= 20 then
Also im asking what script is responsible of setting the value of max resets.
1 Like
i just used a public version of utmm kit 2.1,i dont really know