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

0

uh set ResetPlayerGuiOnSpawn to false on StarterGui

0

and don't use _G for global variables use module scripts

0

omg that was super obvious