I want to know how to make a script that can change ClickDetector cursor icon the way that it will be working on every ClickDetector that is located in workspace. I already tried searching and i could make it work only on one brick. (Excuse my bad english please)
local clickDetector = game.Workspace.Part.ClickDetector
local icon = "rbxassetid://878096274"
local icon2 = "rbxassetid://878076293"
clickDetector.MouseHoverEnter:connect(function(player)
local mouse = player:GetMouse()
mouse.Icon = icon
end)
clickDetector.MouseHoverLeave:connect(function(player)
local mouse = player:GetMouse()
mouse.Icon = icon2
end)
This is the script that i've been using.

10 comments
If you don't understand anything or need clarification, just comment.
Thank you, but i forgot to mention that the script is local and located in PlayerGui and the code that you wrote might not work because of that.
As long as the game is filtering disabled, the code should work. If you have filtering enabled, tell me and I can revise it to work for you.
The Filtering Enabled is disabled and there seems to be an error at line 17 (There is red line under " ) " )
My apologies, I added an extra ")" at the end. I revised it. Sorry again for the inconvenience..
It's fine, thanks for the help!
if worked accept the answer
How do i accept it? (I am completely new to this website)
I believe there is a button under my answer that says something like "Accept answer"
I cant see any buttons except "Report" button under your answer.