I've been trying for a while now and what I want to make is for this script to stay the same once you LoadCharacter, but it completely resets. Like if you activate the button, then respawn, it is deactivated. Why can't there just be a ResetOnSpawn option for scripts? >:C
_G.RobloxAdvanced.BloodEnabled = false
local parent = script.Parent
local function on()
_G.RobloxAdvanced.BloodEnabled = true
-- So if someone clicks the button, it activates. As I said, it doesn't stay activated.
end
local function off()
_G.RobloxAdvanced.BloodEnabled = false
end
local function OnClicked()
if _G.RobloxAdvanced.BloodEnabled == true then off() else on() end
end
parent.MouseButton1Click:connect(OnClicked)
If someone knows how to fix it, please help me. It's probably very obvious but i'm a noob.
Thanks.

3 comments
uh set ResetPlayerGuiOnSpawn to false on StarterGui
and don't use _G for global variables use module scripts
omg that was super obvious