Need help with ScreenGui scripting

What I want: When my label is not visible I want the ResetOnRespawn to be turned off but when it is visible I want ResetOnRespawn to be turned on.

In theory my script should work but isn’t.

Script:

local lableVis = script.Parent.Parent.Parent.Parent.SpeedGui.Label
local speedGui = script.Parent.Parent.Parent.Parent.SpeedGui

local function playSound()
	script.Parent.Parent.Parent.Click:Play()
end

script.Parent.MouseButton1Click:Connect(function()
	lableVis.Visible = not lableVis.Visible
	speedGui.ResetOnSpawn = lableVis.Visible
	playSound()
end)

Why isn’t the below line not working?

speedGui.ResetOnSpawn = lableVis.Visible

Any advice is helpful!

Just use bools instead of what you’re doing for lableVis.Visible and speedGui.ResetOnSpawn

Disabling ResetOnSpawn on playergui does not work. How it works is, when a player dies, it checks if in StarterGui the gui has ResetOnSpawn enabled, if yes then it will delete and load in a new UI for you. (it does not matter if you have ResetOnSpawn enabled or disabled in your playergui or client side startergui)

I would recommend having set ResetOnSpawn to false in startergui in studio, and then do whatever you wanna do in code. I can help you further if you can tell me what you are trying to achieve.

I have a text label I can toggle on and off, I basically want ResetOnRespawn disabled if that text label is toggled off and if its toggled on then I want ResetOnRespawn enabled.

Yes I do know that, but as I’ve said, guis in startergui can’t change, so setting ResetOnSpawn to true or false won’t work. If you can tell me why you are trying to do this, I can give you a better way/method.