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

a gui that makes blocks disappear depending on the color?

Asked by 3 years ago

pls help me! How can i make a gui that changes colors every 10 sec and depending on the color that it is , it will make a platform with the same color disappear ! Pls help ! i cant find the answer for about a week , pls help

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago
local platforms = workspace.PlatformsFolder --put all the platforms in a folder

colors = { --table of colors
    BrickColor.new("Really blue"), --Really red
    BrickColor.new("Really red"), --Really blue
    BrickColor.new("Deep orange") --Deep orange
}

while true do 
    local color = colors[math.random(1,#colors)] --index the table and get a random color with math.random
    print(color)
    for i,v in pairs (platforms:GetChildren()) do --get children returns a table of the children in the platforms folder. for i,v in pairs goes through this table
        if v:IsA("BasePart") then --check if value is a base part
            if v.BrickColor == color then --if the color of the value is the same as the random color chosen then
                v.CanCollide = false 
                v.Transparency = 1
            else --if not
                v.CanCollide = true
                v.Transparency = 0
            end
        end
    end
    wait(5) --wait however long in between color changes
end

Okay, there turned out to be a bunch of issues in my original script. I went into studio and fixed it. This should work. Make sure when you're picking your platform colors, you do so using brick color and not manually typing the rgb values. For some reason I couldn't get it so that you can have custom colors.

0
oh k , thanks imma try , ty alot xbloodyguyx 10 — 3y
Ad

Answer this question