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 » Scripters
Home Search
 

Why doesn't the text change

Previous Thread :: Next Thread 
Luminak is not online. Luminak
Joined: 27 May 2012
Total Posts: 2809
06 Jul 2015 08:59 AM
plr = game.Players:GetChildren()
wait(5)
plr.PlayerGui.main.plrs.Text = "hi"
Report Abuse
Luminak is not online. Luminak
Joined: 27 May 2012
Total Posts: 2809
06 Jul 2015 09:04 AM
b
Report Abuse
lululukas is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
06 Jul 2015 09:05 AM
for i,v in pairs(game.Players:GetChildren()) do
wait(5)
v.PlayerGui.main.plrs.Text="hi"


Try that.
Report Abuse
Luminak is not online. Luminak
Joined: 27 May 2012
Total Posts: 2809
06 Jul 2015 09:07 AM
nope and you forgot the end
Report Abuse
lululukas is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
06 Jul 2015 09:07 AM
So add on the end
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
06 Jul 2015 09:10 AM
plr = game.Players:GetChildren()
This returns a table, not a reference to an object.

-- LocalScript or (Server)Script
for _, Player in pairs(game.Players:GetPlayers()) do
print(Player.Name)
end

But, your script would error, LocalScript or (Server)Script; it must be a LocalScript and can only be done PER player. This is because client's can't access other player's PlayerGui, and the server can't at all.

-- LocalScript
local Player = game.Players.LocalPlayer -- The client's Player object
wait(5)
Player.PlayerGui.main.plrs.Text = "hi"
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
06 Jul 2015 09:12 AM
Relevant readings:

http://wiki.roblox.com/index.php?title=Table
http://wiki.roblox.com/index.php?title=Pairs#pairs
http://wiki.roblox.com/index.php?title=API:Class/Script
http://wiki.roblox.com/index.php?title=API:Class/LocalScript
http://wiki.roblox.com/index.php?title=LocalPlayer
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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