generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How would I use a LocalScript?

Previous Thread :: Next Thread 
Azureous is not online. 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
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
11 Jan 2014 11:23 PM
... server script might be better in this case
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
11 Jan 2014 11:23 PM
okay, thanks @void
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
11 Jan 2014 11:26 PM
It didn't work

._.
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
11 Jan 2014 11:29 PM
Put the script in serverscriptstorage, not startergui
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
11 Jan 2014 11:35 PM
It didn't work… what?

._.
Report Abuse
robomax11 is not online. 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
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
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
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
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 is not online. 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 is not online. 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 is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
11 Jan 2014 11:52 PM
Thanks! :P
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image