So Im making a mini game and when I tell the GUI to change it wont.. every time you die it dose but I want the gui to change smoothly.. help please.
minigames = game.Lighting.Minigames:GetChildren() h = game.StarterGui.Ament.TextLabel while true do if game.Players.NumPlayers > 1 then h.Text = "Choosing Game..." wait(3) ranGame = math.random(1, #minigames) gameChosen = minigames[ranGame] h.Text = "Minigame Chosen: " .. gameChosen.Name wait(3)
You're changing the StarterGui object. StarterGui basically clones and resets Guis in a Player's PlayerGui on reset. Which means, anything you add or change in StarterGui will not appear after you respawn. A way you can avoid this is using a for loop to go through all players of the game, and change that label.
minigames = game.Lighting.Minigames:GetChildren() while true do if game.Players.NumPlayers > 1 then for _,v in pairs(game.Players:GetChildren()) do --:GetChildren sets up a table of objects (or the players), the for loop will go through all players until it is done. v.PlayerGui.Ament.TextLabel.Text = "Choosing Game..." --PlayerGui is what is displayed to the user in real time, changes here are seen. end wait(3) ranGame = math.random(1, #minigames) gameChosen = minigames[ranGame] for _,v in pairs(game.Players:GetChildren()) do --Same thing here. v.PlayerGui.Ament.TextLabel.Text = "Minigame Chosen: " .. gameChosen.Name end wait(3)
Warning; will not work if filtering enabled is enabled.