So the command i want to do is :slock, then it would make the whole gui fades in but for everyone to see it. But when i say :unslock, it would fades in again but as another text. Basically i want the server to be locked but also for the gui to show to everyone, it has to fade in though. This is at what i am right now.
----Script is in workspace------ local slock = false local ServerlockGui = game.StarterGui.ServerLock.Frame --This would fades in along with the text and would fades ---- local LockOn = ServerlockGui.ServerlockOn ----it would fade in---- local LockOff = ServerlockGui.ServerlockOff game:GetService("Players").PlayerAdded:Connect(function(plr) if slock == true then plr:Kick("The server is locked.") elseif slock == false then wait() end plr.Chatted:connect(function(msg) if msg == ":slock" then slock = true for fadesin = 0,1, .0 do LockOn.TextTransparency = fadesin end wait(2) for fadesout = 1,0. .-.1 do LockOn.TextTransparency = fadesout end ---Now the unslock command---- plr.Chatted:connect(function(msg) if msg == ":slock" then slock = false for fadesin = 0,1, .0 do LockOff.TextTransparency = fadesin end wait(2) for fadesout = 1,0. .-.1 do LockOff.TextTransparency = fadesout end
I am confused because i can't make it seen by everyone and i don't know how, can i get some help ?
You can use a in pair loop or remote event.
In-pair loop
for i, v in pairs (game.Players:GetPlayers()) do -- Event for every player. end
Remote Event (Put in ReplicatedStorage)
Script 1:
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent") RemoteEvent:FireAllClients()
Script 2 (LocalScript):
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent") RemoteEvent.OnClientEvent:Connect(function() -- Your desired event. end)
Use FireAllClients
, which basically is a remote event for GUIs, this will make the gui visible.
'Also, when the game starts the gui's are not in the StarterGUI', they're in the PlayerGUI located in the player. I'm going to skip that and put a local script in the ScreenGUI so we do not need to reference it.
Then insert the gui variable as the parameter in fireallclients. Then handle the GUI, from the server script.