Hey,
I have a spectate Gui in my game, and I want to know how to make the spectate gui transparent (so visible = false) once a player dies (health = 0).
I have tried a multitude of scripts, but none of them seemed to properly worked.
Here is the script :
local mapsinserverstorage = game:GetService('ServerStorage'):GetChildren()
local chosenmap = mapsinserverstorage[math.random(1, #mapsinserverstorage)]
function onClick()
script.Parent.Visible = false
script.Parent.Parent.Close.Visible = true
script.Parent.Parent.Bar.Visible = true
script.Parent.Parent.Button.Visible = true
script.Parent.Parent.DescriptionFrame.Visible = true
script.Parent.Parent.ShopTitle.Visible = true
end
script.Parent.MouseButton1Down:connect(onClick)
while true do
if game.Players.LocalPlayer.HealthDisplayDistance == 0
then game.Players.LocalPlayer.PlayerGui.Spectate.Spectate.Open.Visible = false
end
end
Someone please help me!
Thanks, Joy.**

1 comment
try adding Workspace.StarterGUI.{GUI name} transparency something 1 after if game.players.localplayer.healthdisplaydistance ==0