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: MouseEnter

Previous Thread :: Next Thread 
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
18 Jun 2014 03:57 PM
I have been stumped as to why I can not get MouseEnter to work properly. I have tried it several different ways and my GUI objects are set to active, yet nothing seems to work.

_G.start.MouseEnter:connect(function()
print("Hovered");
end)

_G.start being declared as a global variable that points to my GUI object.

I have also tried this:

function Enter()
print("Hovered");
end

_G.start.MouseEnter:connect(Enter)

I have done this before in another game, and the scripts are strikingly similar. It just doesn't want to work in this one though.

Any ideas?

Thank you
Report Abuse
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
18 Jun 2014 03:58 PM
Why do you need to make a function global? Anyways, you're setting the Global setting to an event, not a variable.

_G.Enter = function()
print("Hovered");
end

start.MouseEnter:connect(_G.Enter)
Report Abuse
Usering is online. Usering
Joined: 18 Aug 2012
Total Posts: 10281
18 Jun 2014 03:59 PM
Oh sorry I didn't read that right. I'll look into it.
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
18 Jun 2014 04:29 PM
Yeah, for this case, I'm not needing a global function. Just trying to figure as to why it doesn't trigger the event. I was doubting that it was my code before, but I began to wonder after not getting it to work for an entire day. As said though my GUI objects are set to active, so it should be able to see it when placing the mouse on the object.
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
18 Jun 2014 04:39 PM
Tell us how you defined
_G.start
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
18 Jun 2014 04:51 PM
_G.start = _G.menuGUI.start;

menuGUI just being a screenGUI in the player's GUI. _G.start is just a textbutton in menuGUI(ScreenGui)
Report Abuse
Legoman654 is not online. Legoman654
Joined: 05 Jun 2008
Total Posts: 534
18 Jun 2014 06:44 PM
Still having issues with this, unfortunately.
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