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 » Scripters
Home Search
 

Re: Mouse Icon wont change

Previous Thread :: Next Thread 
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 03:42 PM
The mouse icon works when it leaves, just not when it enters.

script.Parent.MouseEnter:connect(function()
local mouse = game.Players.LocalPlayer:GetMouse()
print("Entered!")
mouse.Icon = "rbxassetid://388548565"
print(mouse.Icon)
end)

script.Parent.MouseLeave:connect(function()
local mouse = game.Players.LocalPlayer:GetMouse()
print("Left!")
mouse.Icon = "rbxassetid://388548464"
print(mouse.Icon)
end)


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 03:44 PM
By the way, it's hovering over an Image GUI


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
26 Mar 2016 03:44 PM
are you sure the id is valid.

you should define the mouse beforehand

loal player = game.Players.LocalPlayer
local mouse = player:GetMouse()
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 04:05 PM
Where's this all located?


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 04:09 PM
Okay, so this is a story driven game:

StarterGui
-SceneOneWindows
--Frame3
---GoogleChrome
----LocalScript


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 04:13 PM
local mouse = game.Players.LocalPlayer:GetMouse()

script.Parent.MouseEnter:connect(function()
print("Entered!")
mouse.Icon = "http://www.roblox.com/asset?id=388548565"
end)

script.Parent.MouseLeave:connect(function()
print("Left!")
mouse.Icon = "http://www.roblox.com/asset?id=388548464"
end)


Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 04:13 PM
You only need to define what the local mouse is once. Doing it for every function is just overkill.


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 04:14 PM
It still doesn't work, same problem.


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 04:26 PM
The script only works when you enter or leave a part of the GUI.

You'll enter "GoogleChrome" but you'll have to fully move the mouse of that part of the GUI for it to see the "leave" function.


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 10:19 PM
So... how does this make a difference on changing the mouse?


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
Ortron is not online. Ortron
Joined: 19 Jul 2013
Total Posts: 1297
26 Mar 2016 10:21 PM
Errors?
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 10:21 PM
The script worked for me. I'm not sure what the problem is.


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 10:22 PM
Odd...
There are no errors. It just changes to the default selected icon and prints entered and left


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 10:26 PM
What is GoogleChrome?


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 10:29 PM
GoogleChrome is an ImageButton. It has a TextLabel inside it, and the icon is being changed by a local script. I can upload a screenshot if you would like


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
c9_io is not online. c9_io
Joined: 15 Feb 2014
Total Posts: 2642
26 Mar 2016 10:32 PM
The hovering icon overrode your icon
Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 10:33 PM
So.. how do I fix that?


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 10:34 PM
I think I know the problem. Mouse.Icon refers to the default icon, and the dark one is a different name. Not sure if that's right though, I haven't dealt with mouse icons directly before.


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 10:35 PM
This post seems to say it wont work when hovering over...

http://wiki.roblox.com/index.php?title=API:Class/Mouse/Icon

But this post says otherwise...

http://wiki.roblox.com/index.php?title=Mouse_Appearance


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 10:36 PM
Yea, that's the problem. Hovering cancels out the change.


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 10:37 PM
Does that mean there isn't a way to fix that?


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 10:39 PM
I don't believe so. I can't seem to find any tutorials on it.


Report Abuse
FireController1847 is not online. FireController1847
Joined: 17 Jan 2013
Total Posts: 1828
26 Mar 2016 10:40 PM
Darn. Was looking forward to this. Welp, better go put a suggestion in the suggestions forum. Anybody who wants to come support please come!


#code print("Its roblox. Dont " .. script.Parent.Insult1)
Report Abuse
c9_io is not online. c9_io
Joined: 15 Feb 2014
Total Posts: 2642
26 Mar 2016 10:43 PM
Please learn to use google like seriously. There are alternatives to this but whether it is more efficient is not a 100% chance probably less efficient but
Report Abuse
DrSaint is not online. DrSaint
Joined: 14 Oct 2009
Total Posts: 18429
26 Mar 2016 10:49 PM
@C9

Elaborate?


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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