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

How can i make all clickdetector icons change? (All clickdetectors in workspace)

Asked by 4 years ago
Edited 4 years ago

Hello, is there a way to change all clickdetector icons in workspace? could you help me? I have too many clickdetectors so i can't change them by hand.

1 answer

Log in to vote
0
Answered by
pwx 1581 Moderation Voter
4 years ago

This may or may not be laggy depending on how many parts your place has, but GetDescendants is a great way to locate every child within' an array.

local CursorId = "2287179355" -- id of the decal you want the mouse changed to

for _,v in pairs(workspace:GetDescendants()) do
    if v:IsA('ClickDetector') then
        v.CursorIcon = "rbxassetid://"..CursorId
    end
end
0
You are awesome works with no lag. TheMostDelikanliMan -14 — 4y
0
Glad to hear. pwx 1581 — 4y
Ad

Answer this question