Random color change
Key RequiredUniversal

Random color change

Universal Scriptptio7402ptio7402 33.5K views 758 executesUpdated Feb 4, 2025
Unrated
00
Lua Script•16 lines (478 chars)
local part = script.Parent  -- The part that triggers the effect

local function onTouch(hit)
    local character = hit.Parent
    local humanoid = character:FindFirstChildOfClass("Humanoid")

    if humanoid then
        for _, v in pairs(character:GetChildren()) do
            if v:IsA("BasePart") then
                v.Color = Color3.new(math.random(), math.random(), math.random()) -- Random RGB color
            end
        end
    end
end

part.Touched:Connect(onTouch)

Features & Information

Mu
#local part scriptParent The part that triggers the effect local function onTouchhit local character hitParent local humanoid characterFindFirstChildOfClassHumanoid if humanoid then for#v in pairscharacterGetChildren do if vIsABasePart then vColor Colornewmathrandom#mathrandom#mathrandom Random RGB color end end end end partTouchedConnectonTouch

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts