Help with an intermmision script

hi today im trying scripting and i have a problem with the script
Captura de pantalla 2021-09-22 a la(s) 20.30.55
this is my script is not working the ui doesn’t make invisible
Captura de pantalla 2021-09-22 a la(s) 20.30.53
![Captura de pantalla 2021-09-22 a la(s) 20.28.40|690x388]
Captura de pantalla 2021-09-22 a la(s) 20.39.59

Try putting the code from the follow:


into a local script within the gui. The problem is that you are setting the visibility from the server, but not the client.

1 Like

you are changing startergui replace it with game:GetService(“Players”).LocalPlayer.PlayerGui since you are using a local script. ( EDIT: I looked at it again. Just make the gui bit a local script anyways, no need to have that in a server script. )

like that


doesn’t work

local pl = game.Players.LocalPlayer
local fr = script.Parent.Parent
local v = game.ReplicatedStorage.TimerValue
spawn(function()
	while wait(1) do
		script.Parent.Text = 'Incoming round in ' .. v.Value
	end
end)
while wait(1) do
	if v.Value == 0 then
		pl.PlayerGui.ScreenGui.Gradient.Visible = false
	else
		pl.PlayerGui.ScreenGui.Gradient.Visible = true
	end
end

issues with your code:

  • localplayer is not defined. you are defining the player service.
  • your second wait loop is unreachable, since you have a loop before it
  • in @Sniperkaos 's code, he is changing the StarterGUI, not the player’s gui
local ps = game:GetService("Players")
local lp = ps.LocalPlayer
local pgui = lp:WaitForChild("PlayerGui")
local sgui = pgui:WaitForChild("ScreenGui")
local Gradient = sgui:WaitForChild("Gradient")
local rs = game:GetService("ReplicatedStorage")
local Val = rs:WaitForChild("TimerValue")
while game:GetService("RunService").RenderStepped:Wait() do
 script.Parent.Text = "Incoming round in: " .. tostring(Val.Value)
 if Val.Value == 0 then
  Gradient.Visible = false
 else
 Gradient.Visible = true
 end
end
1 Like