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: How do I assign a custom click detector decal?

Previous Thread :: Next Thread 
Wulfx is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Wulfx
Joined: 07 Aug 2009
Total Posts: 2719
14 Aug 2016 11:10 AM
I fixxed it, nevermind, thanks so much :)
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