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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Extremely simple GUI scripting question.

Previous Thread :: Next Thread 
dribson is not online. dribson
Joined: 30 Jan 2010
Total Posts: 13635
01 Nov 2011 04:01 PM
I haven't worked with scripts in a while, let alone GUI's.
I've been able to get these to work, but not right now.

function onMouseButton1Down()
script.Parent.Text = " "
end

script.Parent.MouseButton1Down.connect:onMouseButton1Down

I know the basics of scripting, I'm just refreshing what I've learned and trying new techniques.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
01 Nov 2011 04:03 PM
script.Parent.MouseButton1Down:connect(function()
script.Parent.Text = " "
end)
Report Abuse
qwerty1806 is not online. qwerty1806
Joined: 20 Sep 2008
Total Posts: 737
01 Nov 2011 04:03 PM
Here is a fixed version:

function onMouseButton1Down()
script.Parent.Text = ""
end

script.Parent.MouseButton1Down.connect(onMouseButton1Down)

Or, to be more efficient:

script.Parent.MouseButton1Down.connect(function
script.Parent.Text = ""
end)
Report Abuse
bagwan12345 is not online. bagwan12345
Joined: 17 Dec 2009
Total Posts: 1498
01 Nov 2011 04:05 PM
function onMouseButton1Down()
script.Parent.Text = ""
end

script.Parent.MouseButton1Down.connect(onMouseButton1Down)


--[[ the above is correct :) ]]
Report Abuse
dribson is not online. dribson
Joined: 30 Jan 2010
Total Posts: 13635
01 Nov 2011 04:06 PM
Thanks.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
01 Nov 2011 04:08 PM
"Or, to be more efficient:
script.Parent.MouseButton1Down.connect(function"

(function()*

Anyway, anonymous functions aren't more efficient/less efficient, both the same (Depending on what you;re wanting to do)
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