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: MouseHoverEnter/Leave Stuff

Previous Thread :: Next Thread 
Postured is not online. Postured
Joined: 02 Feb 2012
Total Posts: 114
25 Jun 2012 02:06 PM
This script is supposed turn the part to black when you hover your mouse over it, and then to grey when the mouse leaves it. Output is telling me, however, that MouseHoverEnter isn't a valid member of Part. It also states that lines 5 and 11 need a ')' near playerWhoHovered, which does not make sense. Could someone please help?

X = script.Parent
Det = script.Parent.ClickDetector

function Meter(MouseHoverEnter)
if Det.MouseHoverEnter(Player playerWhoHovered) then -- Line 5
X.BrickColor = ("Really black")
end
end

function Meterless(MouseHoverLeave)
if Det.MouseHoverLeave(Player playerWhoHovered) then -- Line 11
X.BrickColor = ("Medium stone grey")
end
end

X.MouseHoverEnter:connect(Meter)
X.MouseHoverLeave:connect(Meterless)

> ↑ And that is how you confuse an atomic computer. ↑ ▬ Xžε⌐¡z○╖
Report Abuse
LordSymphonic is not online. LordSymphonic
Joined: 20 Jun 2012
Total Posts: 101
25 Jun 2012 02:15 PM
Those events are members of the ClickDetectors.
Report Abuse
Postured is not online. Postured
Joined: 02 Feb 2012
Total Posts: 114
25 Jun 2012 02:19 PM
LordSymphonic, how would I address this?

> ↑ And that is how you confuse an atomic computer. ↑ ▬ Xžε⌐¡z○╖
Report Abuse
LordSymphonic is not online. LordSymphonic
Joined: 20 Jun 2012
Total Posts: 101
25 Jun 2012 02:20 PM
I think you did the events/functions incorrectly. Try:

X = script.Parent
Det = X.ClickDetector

Det.MouseHoverEnter:connect(function()
X.BrickColor = BrickColor.new("Really black")
end)

Det.MouseHoverLeave:connect(function()
X.BrickColor = BrickColor.new("Medium stone grey")
end)
Report Abuse
Postured is not online. Postured
Joined: 02 Feb 2012
Total Posts: 114
25 Jun 2012 02:23 PM
Sweet, it works. Thank you.

> ↑ And that is how you confuse an atomic computer. ↑ ▬ Xžε⌐¡z○╖
Report Abuse
LordSymphonic is not online. LordSymphonic
Joined: 20 Jun 2012
Total Posts: 101
25 Jun 2012 02:25 PM
No problem.
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