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
 

"Cannot set Icon of a PlayerMouse" - Custom Cursor

Previous Thread :: Next Thread 
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 11:33 AM
The following is in a LocalScript:

mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = "http://www.roblox.com/asset/?id=58238126"

It doesn't work to set a custom cursor with mouse.Icon, and tells me in the output that I "Cannot set Icon of a PlayerMouse"

I can use it in a Tool just fine, but when I find the mouse through the GetMouse() method instead of through a tool equipped event, it doesn't set me set the Icon...?
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
06 Mar 2014 11:36 AM
You can't set the icon using GetMouse() that way, unfortunately.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 11:38 AM
Unfortunately..

GetMouse can do everything BUT set the mouse..

So have a tool in lighting with this in it:

tool = script.Parent
tool.Equipped:connect(function(mouse)
mouse.Icon = "link here"
tool:destroy()
end)

and then
Localscript in startergui

plr = game.Players.LocalPlayer
repeat wait() until plr.Character
c = plr.Character
t = game.Lighting.Tool:clone()
t.Parent = c

--should work,untested
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 12:30 PM
Well that's lame. They need to add that functionality.

and @islandmaker, Yeah I've done tricks like that to get the player's mouse before they added the GetMouse method for players, when tools were the only way to get the mouse.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 12:32 PM
Well using tools/hopperbins(idk about hopperbins) is the only way to set the icon,far as ik..
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 12:58 PM
this actually doesn't work because as soon as any tool with a mouse icon is removed from the character, the mouse icon reverts back to the default mouse icon.

Urrgh, this is really annoying... I build a whole gun system without using roblox tools, using the GetMouse method as the alternative... but I kinda don't want an 'arrow' cursor in the middle of my screen where the gun target should be.
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 12:59 PM
Now I don't know what I should do...
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 01:06 PM
Ok... with a Hopperbin if it is removed after setting the mouse icon, it actually does stay... problem is, you can't force people to select a hopperbin the same way you can force people to equip a tool by parenting it to the character.
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
06 Mar 2014 01:09 PM
Well when they spawn you could put a black gui covering the screen telling them to equip the hopperbin, then when they equip it, delete the Gui
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 01:11 PM
There must be a way to force equip a hopperbin tho..
Gotta search dis up..
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 01:15 PM
Yeah I know I've done this before when I used tools/hopperbins to access the player mouse without actually wanting a tool, before they added GetMouse(). I'd rather not have to force them to click a hopperbin by blocking out their screen until they do, but seems I may have no other choice... dang it why don't they let you set the Icon when you use the GetMouse method... like seriously...
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 01:15 PM
I think its
Hopperbin.Active = true
Or
Hopperbin.Equipped = true
Or something..

Check the properties in a hopperbin,one of them should be "Active" change it to true,and it should be equipped
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 01:16 PM
as far as I've ever known there's never been a way to force equip a hopperbin @island
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 01:16 PM
no, that doesn't work island. Setting the Active property to true does not trigger the Equip event.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 01:18 PM
So
Script in hopperbin:

script.Parent.Selected:connect(function(mouse)
mouse.Icon = ""
script.Parent:Destroy()
end

Localscript in startergui

repeat wait() until game.Players.LocalPlayer.Character
H = game.Lighting.HopperBin:clone()
H.Parent = game.Players.LocalPlayer.Backpack
H.Active = true

Something like that
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 01:18 PM
Err, rather I mean the Select event. Equipped event is for tools, Select is for hopperbins. But yeah, even though when you select a hopperbin, the active property becomes true, setting the active property to true by a script doesn't trigger the Select event.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
06 Mar 2014 01:18 PM
Oh..
That sucks
ROBLOX!Y U DO DIS??
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
06 Mar 2014 01:19 PM
It's a shame we can't set the cursor icon without a tool yet. They said years ago that they were working on adding icon changing to the PlayerMouse ....
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 01:22 PM
years ago? The GetMouse method for getting the player's mouse has not been around for multiple years. But regardless, it's really stupid that the icon can't be changed with this method of getting the mouse.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
06 Mar 2014 01:30 PM
GetMouse has been around for at least 2 years ... right ... ? o_O
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 02:13 PM
I could be wrong, but I really don't think it has.
Report Abuse
filiptibell is not online. filiptibell
Joined: 10 Mar 2013
Total Posts: 2362
06 Mar 2014 02:15 PM
http://wiki.roblox.com/index.php?title=GetMouse_(Method)&action=history
Well, the wiki page for GetMouse has been around for a bit over 2 years..
Report Abuse
Amexurous is not online. Amexurous
Joined: 28 Jan 2014
Total Posts: 324
06 Mar 2014 02:16 PM
Um, guys.

http://wiki.roblox.com/index.php?title=EquipTool_(Method)
Report Abuse
idontkno is not online. idontkno
Joined: 23 Dec 2007
Total Posts: 2345
06 Mar 2014 02:20 PM
@filip, guess I am wrong. hm. Didn't think it had. oh well.

@amex that is a tool, not a hopperbin.
Report Abuse
Amexurous is not online. Amexurous
Joined: 28 Jan 2014
Total Posts: 324
06 Mar 2014 02:20 PM
I don't see why you can't use a tool.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 2Go to page: [1], 2 Next
 
 
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