Can someone please fix my script for me I have tried more than 10 things to fix it...
Well, if you want to change a bricks color to a random one, all you have to do is
part.BrickColor = BrickColor.Random() --assuming part is defined
let me break it down for you. BrickColor is a Data Type of Roblox that stores colors such as "New Yeller". Each BrickColor has its own special numeric id that represents the color. (i.e. 1 is white). BrickColor is a child property of "Part" , meaning it can only exist inside of a part.
print(game.Workspace.Baseplate.BrickColor) --will return the BrickColor of Baseplate
BrickColor.Random is a function or method that generates a random numeric id for the BrickColor. You could use it in a loop to create a rainbow block!
while true do -- a while loop, which repeats while its parameters are true wait(1) --you need a wait or you will crash part.BrickColor = BrickColor.Random() end --don't forget the end to close the loop!
I hope this helped! -connor12260311
--Old script
--brick color change Made by: iiKinqTerm! brick = script.Parent
while true do brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) brick.BrickColor = BrickColor.new.random wait(0.5) end
Closed as Not Constructive by Async_io, Prioxis, and General_Scripter
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?