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: MouseButton1Click() and MouseEnter/MouseLeave

Previous Thread :: Next Thread 
JayTheDJ is not online. JayTheDJ
Joined: 07 Aug 2011
Total Posts: 262
25 Aug 2012 03:47 PM
How do those function work? I'm new to GUI's and I want to learn how you use them. For example, like onClicked you click i the desired object whatever was scripted would happen. How does this work on GUI's.

For example, what I am trying to do is make some simple GUI imagebuttons where they do the basic actions such as kill or sit. How would I do this?


Also, I would like to learn how to use MouseEnter and MouseLeave.
Report Abuse
AdvorsusDuo is not online. AdvorsusDuo
Joined: 17 May 2012
Total Posts: 5265
25 Aug 2012 03:49 PM
MouseButton1Click is an event, not a method.

It fires something when someone leftclicks on something; for example in a gui you could put

script.Parent.MouseButton1Click:connect(function()
print("Someone clicked a Gui!")
end)
Report Abuse
su8qqingcuzbanned is not online. su8qqingcuzbanned
Joined: 28 Jul 2012
Total Posts: 164
25 Aug 2012 03:52 PM
mousebutton1click is a userdata containing connect *method*
Report Abuse
JayTheDJ is not online. JayTheDJ
Joined: 07 Aug 2011
Total Posts: 262
25 Aug 2012 03:53 PM
I was actually looking how to word line 1.

If I replace the event "MouseButton1Click" with "MouseEnter" then would whatever the desired thing I want to enter still work?
Report Abuse
AdvorsusDuo is not online. AdvorsusDuo
Joined: 17 May 2012
Total Posts: 5265
25 Aug 2012 03:54 PM
It's primary use is as an event, for example script.Parent.MouseButton1Click:connect()
Report Abuse
JayTheDJ is not online. JayTheDJ
Joined: 07 Aug 2011
Total Posts: 262
25 Aug 2012 04:11 PM
script.Parent.MouseEnter:connect(function()
print("Someone moved over this gui!")
end)

Would work?
Report Abuse
JayTheDJ is not online. JayTheDJ
Joined: 07 Aug 2011
Total Posts: 262
25 Aug 2012 04:56 PM
HELP!

Ok so I have a scripting problem, I tried modifying a script and even using the output but nothing is helping me.

I want to use "MouseEnter" and "MouseLeave"

If the mouse enters the TextBox will be visible

TextBox.Visible = true

and when the mouse leaves

TextBox.Visible = false
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Aug 2012 05:06 PM
Post the script, but your example was used correctly, assuming that the script's parent was a GuiObject.

¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3]
Report Abuse
JayTheDJ is not online. JayTheDJ
Joined: 07 Aug 2011
Total Posts: 262
25 Aug 2012 05:27 PM
I looked it up on the wiki and it showed me this, " Arguments x, and y specify the absolute pixel position of the mouse." So I looked up the ResetButton's AbsolutePosition and it showed me 0,0. So this is what I did. (So that no one claims I'm asking for the scripts)


script.Parent.MouseEnter(0,0):connect(function()
TextBox.Visible = true
end)

NOTE: The TextBox is in the ResetButton.

I do not know how to do the mouse leave.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
25 Aug 2012 05:31 PM
script.Parent.MouseEnter:connect(function()
TextBox.Visible = true
end)
script.Parent.MouseLeave:connect(function()
TextBox.Visible = false
end)

¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3]
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