script.Disabled not working

The title pretty much states the question.

The script:

wait(6)
script.Parent.Visible = false
script.Disabled = true

(This is a local script which is under a frame in starterGUI)

Do you mean:

wait(6)
script.Parent.visible = false
script.Enabled = false

In what way is it not working?

It is not destroying the script, or disabling it I meant.

script.Enabled isn’t a thing.

1 Like

Disabling a script won’t immediately cut off the script. Disabling will only break loops and disconnect events. If you want to cut off immediately, you’ll want to return directly after.

Example with your code:

task.wait(6)
script.Parent.Visible = false
script.Disabled = true
return
1 Like

Doesn’t work, still shows the UI after you reset.

Gui has a property called ResetOnSpawn. Uncheck that if you don’t want that to happen.

1 Like

The UI showing after you reset isn’t due to the script.
All ScreenGUIs have a ResetOnRespawn property, which causes it to reset the GUI whenever the player is respawned.

Maybe its because Localscripts cannot disable stuff. Though I’m not sure

That makes no sense. LocalScripts are capable of disabling other scripts that run in the client.