But that just causes a loop, if I can only use PlayerGui in local scripts, and local scripts cant be disabled while in game, how am I supposed to enable the script? I might misspoke, In a nutshell: How can I enable a disabled script that is in StarterGui?
They can be disabled in game since you control your client. You have to go into your playerGui
Yes I know that, but what would I need to type to disable/enable it for a client using a script? For example,
wait(10)
game.StarterGui.bright.fadewhite.Disabled = false
in a regular or local script does not enable it for the client
If you want to disable a script you need to use .Disabed = true
And this will only work in a local script.
If you are doing it correctly, then it might be something else
I was not clear enough, my bad. This is a normal script, itās in workspace itās what i have and it does not work. I want the local script in StarterGui to enable for all clients.
wait(10)
game.StarterGui.bright.fadewhite.Disabled = false
does not work.
You can āuseā Playergui in both local scripts and server scripts.
This is because when you update a gui in the startergui all the versions in everyoneās playerguis wonāt automatically update to the starterguiās version.
wait(10)
for _, Player in pairs(game.Players:GetChildren()) do
Player.PlayerGui.bright.fadewhite.Disabled = false
end
Try this instead, it loops through everyoneās playerguis and enables āfadewhiteā
well theres a few ways if you want to use a normal server script
- Loop through players
by looping through all players you should be able to set their script to be disabled
wait(10)
for _, i in pairs(game.Players:GetPlayers()) do
i.StarterGui.bright.fadewhite.Disabled = false
end
Now I just want to say this loop isnt the best for performance and there is a better way but this will be okay and the difference is very small.
Another thing is this loop is using get players and getchildren also works. The only difference is getChildren will also get anything thats not a player
- Use a remote event
Remote events on the server allow you to FireAllClients which will fire to all clients allowing you to be able to do your script for all players.
There are other ways to do this but I have forgotten a lot of things but these should be okay.
Brilliant! It works! Tysm, Iāve probably bored you a bit oof, thanks for the help very much. Itās 1:50am where I am now, so I will be off. Again, thank you for the help.
Thanks! I tried yours too and it works great, and the enabling/disabling can be easily done via a script. Itās 1:50 where I am so i will go, and sorry if I bothered you with my constant questions or anything.