I'm making a custom clickdetector script, and I'm changing the mouse icon to the ROBLOX one for clickdetectors whenever a certain part is under the mouse. However, I want the mouse to function normally after the mouse's target is no longer the brick. How can achieve this? My current code:
mouse.Move:connect(function()
if player.Character.Humanoid.Health ~= 0 then
if mouse.Target then
local target = mouse.Target
if target:IsDescendantOf(parts) then
print(target)
if mouse.Icon ~= "http://www.roblox.com/asset/?id=433782737" then
mouse.Icon = "http://www.roblox.com/asset/?id=433782737"
end
elseif not target:IsDescendantOf(parts) then
--mouse.Icon
end
end
end
end)
Thanks in advance.

2 comments
Thanks!
No problem.