Hello, i’am having the issue on this:
local D = game.ReplicatedStorage:WaitForChild("Day")
local N = game.ReplicatedStorage:WaitForChild("Night")
local Day = true
game.Players.PlayerAdded:Connect(function(plr)
plr.PlayerGui:WaitForChild("ScreenGui").Menu.DayOrNightButton.MouseButton1Click:Connect(function()
Day = not Day
if Day == false then
N:FireClient(plr)
else
D:FireClient(plr)
end
end)
end)
What i want is that the script doesn’t break when i reset. I will explain for you.
I’am using remote events to make the game day and night, i have this script in ServerScriptService, and other script(LocalScript) in StarterPlayerScripts, when i click an button(Gui button), it makes it day or night, but whenever i reset, it just breaks, how do i fix this?