Wulfx
|
  |
| Joined: 07 Aug 2009 |
| Total Posts: 2719 |
|
|
| 14 Aug 2016 09:54 AM |
I'm trying to change the default cursor ingame, which I can do, but problem is, the parts that are clickable will no longer switch to a different cursor, making it impossible to know what you can click on/cant.
How can I change the click detector cursor? |
|
|
| Report Abuse |
|
|
Wulfx
|
  |
| Joined: 07 Aug 2009 |
| Total Posts: 2719 |
|
|
| 14 Aug 2016 10:16 AM |
local mouse = game.Players.LocalPlayer:GetMouse() mouse.Icon = "rbxassetid://68308747"
This is the script, however I can't get the click detector parts to have a specific cursor icon, please help. |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 14 Aug 2016 10:24 AM |
Unfortunately there's no way to change the mousehover image for clickdetectors, you would have to use Mouse.Move event and check if mouse.Target has a clickdetector in it, if so then change the mouse icon.
|
|
|
| Report Abuse |
|
|
icanxlr8
|
  |
| Joined: 25 Feb 2009 |
| Total Posts: 3686 |
|
|
| 14 Aug 2016 10:32 AM |
Yeah, I had this issue so I just created a custom ClickDetector which would basically go something like this.
Place a remote event named ClickEvent in each object you would have a clickdetector in.
Put the following LocalScript in StarterPlayerScripts
normalicon = "" hovericon = "" local m = game.Players.LocalPlayer:GetMouse() m.Move:connect(function() local t = m.Target if t ~= nil then if t:FindFirstChild("ClickEvent") then m.Icon = hovericon t:FireServer() -- If you want to put arguments in here, go ahead. else m.Icon = normalicon end else m.Icon = normalicon --I put this here in case target happens to be nil and icon doesn't change end end)
Then inside the script you want to read the event
location = nil -- replace nil with the directory of the event, ie game.Workspace.Part location.ClickEvent.OnServerEvent:connect(function(plr) -- Feel free to add more arguments, but you must keep plr or rename it. -- stuff end) |
|
|
| Report Abuse |
|
|
Wulfx
|
  |
| Joined: 07 Aug 2009 |
| Total Posts: 2719 |
|
|
| 14 Aug 2016 11:09 AM |
So the script changes the icon, but it doesn't change when hovering over a the event script, would it be how I wrote location?
For the location I put Location.game.workspace.D1, did I do something wrong? |
|
|
| Report Abuse |
|
|
Wulfx
|
  |
| Joined: 07 Aug 2009 |
| Total Posts: 2719 |
|
|
| 14 Aug 2016 11:10 AM |
| I fixxed it, nevermind, thanks so much :) |
|
|
| Report Abuse |
|
|