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

how do i make the button change color?

i got the value to rise but my backgroundcolor3 isnt going up thoung, help idk what im doing wrong

local color = Vector3.new(1,1,1)
while true do
wait()
repeat
wait()
print(color + Vector3.new(1,1,1))
color = color + Vector3.new(1,1,1)
script.Parent.BackgroundColor3 = Color3.new(color)
print(script.Parent.BackgroundColor3)
until script.Parent.BackgroundColor3 == Color3.new(255,255,255)
--more below going the opposite way
end

prints

65, 65, 65<--rising

0, 0, 0<--not rising

2 comments

0

Vector3 isn't for colors. Try using Color3.fromRGB()

0

has 705 rep >doesnt know how to make button change color >uses vector3 to change color of somthing

1 answer

I would recommend using an if statement instead of a repeat.

Vector3 is mainly for positioning. Color3.new or Color3.fromRGB is to change the color.

local color = script.Parent.BackgroundColor3
while script.Visible do
wait()
if script.Enabled do
color = Color3.new(1,0,0)
elseif script.Enabled = false
color = Color3.new(0,0,1)
end

Tell me if this works, if not... i'll help fix it. My discord is MillerrIAm#9898, if you need help, comment here or friend me there.

3 comments

0

I'm not entirely sure what you were trying to do so yeah.

0

Apologies but you weren't exactly explicit to what you are trying to accomplish

0

ok you obviously are new to scripting because this wont do anything really, scripts cant be visible or invisible and in if statements you dont use do, you use then and if script.Enabled is false then it cant run anything either but thanks for trying

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