i was making a script in the server script service that removes the gui after 5 seconds the error i got is KeyDownGui is not a valid member of Startergui Heres the script
if game.ChildAdded then --- checks if the player is added wait(5) game.StarterGui.KeyDownGui:remove() end
Deleting a gui from the StarterGui
does not delete it for all players, I recommend removing it from each player and after they joined using the ChildAdded
event.
game.Players.ChildAdded:connect(function(player) wait(5) if player and player.PlayerGui then local gui = player.PlayerGui:FindFirstChild'KeyDownGui' if gui ~= nil then gui:remove() end end end)
I hope this helped!