Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a GUI Hint for game? Having hard time help plz

Asked by 9 years ago

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

0
Please put your code in a code block and use grammar so you're easier to understand. Perci1 4988 — 9y

2 answers

Log in to vote
0
Answered by
wjs3456 90
9 years ago

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

0
o code block o thx Coolviper630 95 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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

0
Data perssitence, hmm have no expereience with it, but ima have to learn it. Thanks anyways. ;) Coolviper630 95 — 9y
0
No problem! I like to help people, and I also learn from what other people ask. Thanks for asking, because I may read it and try it just to learn... TheArmoredReaper 173 — 9y
0
I just found a new way to change the aspects of GUIs. First, you have to enter a code found here : http://wiki.roblox.com/index.php?title=ResetPlayerGuiOnSpawn_(Property) TheArmoredReaper 173 — 9y

Answer this question