Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

making a block disappear depending on the color that is on the screen?

so i made a screen and scripted it so it chooses a random color from red, green ,blue, yellow. there are 4 platforms and i want to know how can i make the platform with the color that is shown on the screen to disappear. Here is script of random colors on screen:

wait(30)

while true do

wait(15)

local colors = {

Color3.fromRGB(245, 205, 48);

Color3.fromRGB(0, 137, 207);

Color3.fromRGB(250, 40, 28);

Color3.fromRGB(0,200,0);

}

local color = colors[math.random(1, #colors)]

script.Parent.Color = color
wait(3)

end

1 answer

you can do like a localscript:

Screencolor.Changed:Connect

-- then check what color the Screen is -- then make if statements to make the other 3 platforms dissapear and then only 1 appear

if backgroundcolor3 == Color3.fromRGB(0,200,0) -- 4 main if statements -- make 3 other platforms dissapear and the one you want appear elseif color..... then -- make 3 other platforms dissapear and the one you want appear elseif color.. then -- make 3 other platforms dissapear and the one you want appear elseif color ... then -- make 3 other platforms dissapear and the one you want appear

like that

It's all simplified, I'm just giving you Instructions and you can code the full thing.

1 comment

1

k thanks, imma try

This discussion is preserved as it was. New answers, comments, and votes are closed.