Universal Script 📌
1.7k Views
80.4k Executions

dark texture

10K executions
Universal Script 📌
styear
styear100K executions
7 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Dark texture

View Raw
local Players = game:GetService("Players")

local darkfactor = 0.3

local function darkenColor(color: Color3, factor: number)
    local h, s, v = Color3.toHSV(color)
    v = math.clamp(v * factor, 0, 1)
    return Color3.fromHSV(h, s, v)
end

local function isPlayerCharacter(part: Instance)
    local model = part:FindFirstAncestorOfClass("Model")
    if model then
        return Players:GetPlayerFromCharacter(model) ~= nil
    end
    return false
end

local function isTool(part: Instance)
    return part:FindFirstAncestorOfClass("Tool") ~= nil
end

local function processPart(part: BasePart)
    if not part or not part:IsDescendantOf(workspace) then return end
    if isPlayerCharacter(part) then return end
    if isTool(part) then return end
    if part.Name == "HumanoidRootPart" then return end

    part.Color = darkenColor(part.Color, darkfactor)
end

for _, obj in ipairs(workspace:GetDescendants()) do
    if obj:IsA("BasePart") then
        processPart(obj)
    end
end

workspace.DescendantAdded:Connect(function(obj)
    if obj:IsA("BasePart") then
        task.wait()


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

Tags

More universal scripts

See all
Script hub
16.0k
93.4k
Bumped 46 minutes ago
Key System

Script hub

Kronos New

Universal Script 📌
48.5k
46.7k
Bumped 3 hours ago
Universal Script 📌
1.5k
1.3k
Bumped 6 hours ago
Universal Script 📌
4.2k
56.5k
Bumped 7 hours ago
Universal Script 📌
7.1k
71.8k
Bumped 7 hours ago
Script hub
3.5M
1.2M
Bumped 8 hours ago
Key System