It may be that in a live server, things aren’t fully loaded and may fail instantly. I don’t think this happens in Studio, so that may be the issue. Check if using WaitForChild on these helps.
Edit: I fixed the script, try this, It should work.
while wait() do if Player.PlayerGui["Main_UI"]["Values_Folder"]["Clicks_Value"] then break end end
local ClicksValueFinder = Player.PlayerGui["Main_UI"]["Values_Folder"]["Clicks_Value"]
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
wait(0.4)
ClicksValueFinder .Value = ClicksValueFinder .Value + Player.PlayerGui["Main_UI"]["Values_Folder"]["Click_Stats"].Value
print(ClicksValueFinder)
end)
local Player = game.Players.LocalPlayer
local PlayerGui = Player:FindFirstChild("PlayerGui")
if PlayerGui then
local MainGui = PlayerGui:FindFirstChild("Main_UI")
if MainGui then
local ClicksValueFinder = MainGui["Values_Folder"]["Clicks_Value"]
local Button = script.Parent
Button.MouseButton1Click:Connect(function()
wait(0.4)
ClicksValueFinder.Value = ClicksValueFinder.Value + MainGui["Values_Folder"]["Click_Stats"].Value
print(ClicksValueFinder.Value)
end)
end
end
no errors and doesn’t work. maybe else for player GUI like if PlayerGui then local MainGui = PlayerGui:FindFirstChild("Main_UI") if MainGui then local ClicksValueFinder = MainGui["Values_Folder"]["Clicks_Value"] local Button = script.Parent Button.MouseButton1Click:Connect(function() wait(0.4) ClicksValueFinder.Value = ClicksValueFinder.Value + MainGui["Values_Folder"]["Click_Stats"].Value print(ClicksValueFinder.Value) end) else local ClicksValueFinder = MainGui["Values_Folder"]["Clicks_Value"] local Button = script.Parent Button.MouseButton1Click:Connect(function() wait(0.4) ClicksValueFinder.Value = ClicksValueFinder.Value + MainGui["Values_Folder"]["Click_Stats"].Value print(ClicksValueFinder.Value) end) end end