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

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by
sayer80 457 Moderation Voter
3 years ago

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
k thanks, imma try xbloodyguyx 10 — 3y
Ad

Answer this question