Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
|
| 11 Jan 2014 11:20 PM |
To make the text of a TextLabel in a ScreenGui in the StarterGui be random?
This is what I have so far:
local Texts = {"string1", "string2", "string3"}
while wait(5) do game.StarterGui.ScreenGui.Frame.Change.Text = Texts[math.random(1,#Texts)] end
--Would that work? |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 11:23 PM |
| ... server script might be better in this case |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
| |
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
| |
|
|
| 11 Jan 2014 11:29 PM |
| Put the script in serverscriptstorage, not startergui |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
| |
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 11 Jan 2014 11:38 PM |
| you'll have to reset to see the changes |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 11:39 PM |
| Wait... do you want it to change the message every 5 seconds, or just want a random messsage to appear every time they respawn? I assumed you wanted a random message to appear every time you respawn... |
|
|
| Report Abuse |
|
|
|
| 11 Jan 2014 11:42 PM |
If its the first case this is what you want
local Texts = {"I am a potato", "I like trains", [[Riptide > all]]} while wait(5) do for k, p in pairs(game.Players:GetPlayers()) do coroutine.resume(coroutine.create(function() p.PlayerGui.ScreenGui.Frame.Change.Text = Texts[math.random(#Texts)] end)) end end |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
|
| 11 Jan 2014 11:42 PM |
| Every 5 seconds… I wanted a new message |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 11 Jan 2014 11:43 PM |
use void's
it'll change the message without u reseting |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
| |
|