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
 

Re: onClick Gui Text

Previous Thread :: Next Thread 
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:20 PM
This script is meant to change the text on a gui on your screen. It works fine in solo, but it doesn't work in multiplayer.

function onClicked(playerWhoClicked)
game.Players.Player.PlayerGui.brogui.TextLabelswag.Text = "Testing"
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

dat creepy bunny who stares through your window
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:24 PM
Bump.

dat creepy bunny who stares through your window
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:26 PM
bump2

dat creepy bunny who stares through your window
Report Abuse
DrRandomous is not online. DrRandomous
Joined: 25 Mar 2011
Total Posts: 1702
05 Feb 2014 01:27 PM
Make sure it is a local script.

function onClicked(playerWhoClicked)
if not game.Players.LocalPlayer then return end
game.Players.LocalPlayer.PlayerGui.brogui.TextLabelswag.Text = "Testing"
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

-DrRandomous :p
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:30 PM
Thanks, but where do I put the Local Script?

dat creepy bunny who stares through your window
Report Abuse
CommanderPonds is not online. CommanderPonds
Joined: 30 May 2009
Total Posts: 18782
05 Feb 2014 01:31 PM
This is also a solution:

>game.Players.Player.PlayerGui.brogui.TextLabelswag.Text = "Testing"

replace this with

game.Players:findFirstChild(playerWhoClicked.Name).PlayerGui.PlayerGui.brogui.TextLabelswag.Text = "Testing"
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:35 PM
Doesn't work.

dat creepy bunny who stares through your window
Report Abuse
CommanderPonds is not online. CommanderPonds
Joined: 30 May 2009
Total Posts: 18782
05 Feb 2014 01:40 PM
Is it a ClickDetector in workspace or a GUI in the PlayerGui where this script is located?
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:43 PM
The click detector is in the part and the script is in the part.

dat creepy bunny who stares through your window
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:47 PM
bump

dat creepy bunny who stares through your window
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 01:53 PM
bump

dat creepy bunny who stares through your window
Report Abuse
CommanderPonds is not online. CommanderPonds
Joined: 30 May 2009
Total Posts: 18782
05 Feb 2014 01:56 PM
Make sure the 'brogui' is in the PlayerGui of everyone who will be clicking it.
I have no idea why my last suggestion didn't work for you, here is the full script I used:

function onClicked(playerWhoClicked)
game.Players:findFirstChild(playerWhoClicked.Name).PlayerGui.brogui.TextLabelswag.Text = "Testing"
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
DarkComa is not online. DarkComa
Joined: 01 Apr 2011
Total Posts: 11679
05 Feb 2014 02:06 PM
Oh, it works now. Thank you. :)

dat creepy bunny who stares through your window
Report Abuse
CommanderPonds is not online. CommanderPonds
Joined: 30 May 2009
Total Posts: 18782
05 Feb 2014 02:07 PM
No problemo.
Good luck scripting.
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