Welp here it is. Please keep in mind that this is my FIRST REAL SCRIPT for a game.
while true do workspace.lunarbutton.brickcolor = BrickColor.blue workspace.lunarbutton.brickcolor = BrickColor.red
end
Welp here it is. Please keep in mind that this is my FIRST REAL SCRIPT for a game.
while true do workspace.lunarbutton.brickcolor = BrickColor.blue workspace.lunarbutton.brickcolor = BrickColor.red
end
That's not how you declare the part's color. In order to do this, you have to use BrickColor.new. Here's one way how it works:
while true do -- declare the loop
wait() -- make sure to add a wait() to avoid crashing
workspace.lunarbutton.BrickColor = BrickColor.new("Bright blue") --We access the part's color and change it to bright blue
wait(2) -- we wait a few seconds again
workspace.lunarbutton.BrickColor = BrickColor.new("Really red") -- The part is now red.
end
Another way to do this is by:
workspace.lunarbutton.BrickColor = BrickColor.Red() --This will make the part's color to red
workspace.lunarbutton.BrickColor = BrickColor.Blue() -- This will turn blue
Keep in mind that there are other types of shades of blue and red. To access these colors, go on studio and you will find a list of colors with their corresponding names.
Also for more information, check these pages:
It doesn't seem to be looping. Even though I fixed everything.
I've tested it myself and it works fine. Try adjusting the wait time.
Okay...i'll try again. Sorry for the nubby-ness. It is my first script after all.
Welcome to scripting, here is your script:
while true do workspace.lunarbutton.brickcolor = BrickColor.blue workspace.lunarbutton.brickcolor = BrickColor.red
end
you already have some issues, while im short on time atm I will fix your code, comment or PM me and ill explain the changes.
function change()
local brickname="Part"
brick = game.Workspace:FindFirstChild(brickname)
brick.BrickColor=BrickColor.Red()
end
change()
I hope it helps! -Sciptr
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
I hope everyone understands that I want a LOOP! Right? I want it to do this infinetly.