Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I change the ClickDetector Cursor/Icon?

Asked by
par1d 19
5 years ago

Is there anyway to change the ClickDetector cursor/icon?

3 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

If you're wondering how to change the player's mouse icon then here's how to do it:

local mouse = player:GetMouse()
mouse.Icon = -- image asset id here

If you want the mouse to change when hovering over a click detector then there is a property of ClickDetector that is just that. It's called CursorIcon and the input is an image asset id.

0
I have changed the player's mouse icon and changed the ClickDetector cursor icon however when I hover over the ClickDetector then player's mouse icon shows not then custom ClickDetector icon. par1d 19 — 5y
0
the** par1d 19 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You can find this stuff with a quick google search. https://developer.roblox.com/en-us/api-reference/property/ClickDetector/CursorIcon

Log in to vote
0
Answered by
EDLLT 146
5 years ago

Ok Here

function sandbox(var,func)
    local env = getfenv(func)
    local newenv = setmetatable({},{
        __index = function(self,k)
            if k=="script" then
                return var
            else
                return env[k]
            end
        end,
    })
    setfenv(func,newenv)
    return func
end
cors = {}
mas = Instance.new("Model",game:GetService("Lighting"))
Part0 = Instance.new("Part")
ClickDetector1 = Instance.new("ClickDetector")
Part0.Name = "SuperPart"
Part0.Parent = mas
Part0.CFrame = CFrame.new(-6.15999985, 0.500003994, -11.5500002, 1, 0, 0, 0, 1, 0, 0, 0, 1)
Part0.Position = Vector3.new(-6.15999985, 0.500003994, -11.5500002)
Part0.Size = Vector3.new(4, 1, 2)
Part0.BottomSurface = Enum.SurfaceType.Smooth
Part0.TopSurface = Enum.SurfaceType.Smooth
ClickDetector1.Parent = Part0
ClickDetector1.CursorIcon = "rbxassetid://73737626"
for i,v in pairs(mas:GetChildren()) do
    v.Parent = workspace
    pcall(function() v:MakeJoints() end)
end
mas:Destroy()
for i,v in pairs(cors) do
    spawn(function()
        pcall(v)
    end)
end

Or alternatively just google it lol

Answer this question