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 4 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 4 years ago
Edited 4 years ago
01local platforms = workspace.PlatformsFolder --put all the platforms in a folder
02 
03colors = { --table of colors
04    BrickColor.new("Really blue"), --Really red
05    BrickColor.new("Really red"), --Really blue
06    BrickColor.new("Deep orange") --Deep orange
07}
08 
09while true do
10    local color = colors[math.random(1,#colors)] --index the table and get a random color with math.random
11    print(color)
12    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
13        if v:IsA("BasePart") then --check if value is a base part
14            if v.BrickColor == color then --if the color of the value is the same as the random color chosen then
15                v.CanCollide = false
View all 24 lines...

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 — 4y
Ad

Answer this question