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
01 | local platforms = workspace.PlatformsFolder --put all the platforms in a folder |
02 |
03 | colors = { --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 |
09 | while 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 |
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.