I tried to make a gui hint for the players but the text keeps on changing reseting, I tried many times to fix this nothing works, I have the gui in StarterGui, the textlabel in the gui, and a script in gui
Here is the script: The gui in the playersGui it keeps reseting when die and stuff idk how to fix dis, I tried many times fixing this, uncluding maps kinda....
tl = script.Parent:WaitForChild("TextLabel") local maps = game.Lighting.Maps:GetChildren()
I use the while loop
while true do
if game.Players.NumPlayers > 1 then -- If there is more then 1 player then start the game!
tl.Text = "Welcome to my game!"
wait(3)
tl.Text = "Intermission: 15 seconds"
for i = 15, 1, -1 do
tl.Text = "Intermission: " ..i.. " seconds"
if i < 2 then
tl.Text = "Intermission: " ..i.. " second"
end
wait(1)
end
tl.Text = "Choosing map..."
randomMap = math.random(1,#maps)
mapChosen = maps[randomMap]
tl.Text = "Map chosen: " ..mapChosen.Name
wait(3)
mapChosenClone = mapChosen:Clone()
mapChosenClone.Parent = game.Workspace
else
tl.Text = "There must be at least 2 or more players to start."
end
wait(3)
end
I really can't be sure because this isn't in code block but I did notice two things.
Pretty sure the first line of the while loop has to be
while true do if game.Players:GetPlayers() > 1 then
And on the map chosen part you left out quotes and the string periods.
tl.Text = "Map chosen: ..mapChosen.Name.."
If you don't know how to use the code block push the blue Lua button above, and put text inside.
Hope this helps
First, I don't think you know that a player's PlayerGui gets destroyed everytime the player dies, and then gets cloned again from StarterGui. You should use Data Persistance to make the values stay the same, but unfortunately I can't help you with that, as I don't have experience using Data Persistance.
I hope someone else can give you a better answer, but I think this will help you for future scripts.
mranderson11