Okay, I have come up with a script thats supposed to change the color of my Baseplate in Workspace. Where should I put the script? In ServerScriptStorage or Workspace. Either way, it still doesn't work. Please help.
number = math.random(1,5) if number == 4 then game.Workspace.Baseplate.BrickColor = BrickColor.Red() end if number == 2 then game.Workspace.Baseplate.BrickColor = BrickColor.Green() end if number == 3 then game.Workspace.Baseplate.BrickColor = BrickColor.Yellow() end if number == 1 then game.Workspace.Baseplate.BrickColor = BrickColor.Orange() end if number == 5 then game.Workspace.Baseplate.BrickColor = BrickColor.Orange() end
Notes:
script.Parent
. It is better to put it in ServerScriptService
since the existence of this script does not need to be replicated to clients.local colors = {BrickColor.Red(), BrickColor.Green(), BrickColor.Yellow(), BrickColor.Orange(), BrickColor.Orange()} local baseplate = workspace.Baseplate function ChangeColor() baseplate.BrickColor = colors[math.random(1, #colors)] end ChangeColor()
wait
command, or connect it all to an event.--Changing the color every second: while true do wait(1) ChangeColor() end
--Changing the color every time someone enters the place game.Players.PlayerAdded:connect(ChangeColor)