Been scripting for a day now and wondering the basics, literally any info someone can give me about coding in roblox would help

can someone also explain what i done wrong with my code, im trying to make a part that changes colour when i stand on it, also the part is called color_change can someone explain what i did wrong
while true do

wait (3)

Part.BrickColor = BrickColor.new(0.3,0.6,0.9)

wait (3)

Part.BrickColor = BrickColor.new(0.1,0.4,0.7)

end

Just loop it, and when its not touching break it
repeat

[code]
until part.touchended()

1 Like

Brick colors can also be numbers for RGB values.

2 Likes

ok but what did i do wrong so i can avoid doing it agian

1 Like

also ty very much for the help

1 Like

honestly nothing is wrong
what is it supposed to be doing and what isn’t it doing

1 Like

oh yes and does the part name have anything to do with it

1 Like

its supposed to every 3 seocnds change colour of the part you’re on

1 Like

Yes it does so instead of
Part.BrickColor = BrickColor.new(0.3,0.6,0.9)
do
color_change.BrickColor = BrickColor.new(0.3,0.6,0.9)

Does it change every 3 seconds?
If not change part to color_change
Edit:
Make the script inside of color_change
and then instead of color_change, do script.parent.BrickColor = BrickColor.new(255,0,0)
[Red, u can change it]

its supposed to thank you for the help :slight_smile:

Oh I actually got it; maybe

while true do
    wait (3)
    game.Workspace.color_change.BrickColor = BrickColor.new(0.3,0.6,0.9)
    wait (3)
    game.Workspace.color_change.BrickColor = BrickColor.new(0.1,0.4,0.7)
end

You have the show the script which part it is actually meant to be changing, otherwise it wouldn’t know which part to change (If you put the part in a model or folder you’ll have to change this by doing something like game.Workspace.Model.color_Change.BrickColour or something like that)

wait do i put it in workspace or serverscriptstorage or the part

Please put code like this:

code here

You can do this by pressing the </> button
image

oh thanks let me try it
< while true do

wait (3)

Part.BrickColor = BrickColor.new(0.3,0.6,0.9)

wait (3)

Part.BrickColor = BrickColor.new(0.1,0.4,0.7)

end>

oh i dont get it :confused: 30charrrrrr

repeat
wait (3)

script.parent.BrickColor = BrickColor.new(0.3,0.6,0.9)

wait (3)

script.parent.BrickColor = BrickColor.new(0.1,0.4,0.7)
until script.parent:touchended()

Make the script the child of the color change block

not like that. look at the top things here and press on the </> icon
image

while true do
	wait (3)
	Part.BrickColor = BrickColor.new(0.3,0.6,0.9)
	wait (3)
	Part.BrickColor = BrickColor.new(0.1,0.4,0.7)
end
```thank you

Thats just going to loop infinitely, regardless if you are touching it…