UserInputService = game:GetService("UserInputService") local Spawn1 = game.Workspace.SpawnLocation UserInputService.InputBegan:Connect(function(input, GameProcessedEvent) local RandomEvent = math.random(1,5) if input.KeyCode == Enum.KeyCode.E and RandomEvent == 1 then Spawn1 = BrickColor.new("Really red") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 2 then Spawn1 = BrickColor.new("Baby blue") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 3 then Spawn1 = BrickColor.new("Gold") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 4 then Spawn1 = BrickColor.new("Grey") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 1 then Spawn1 = BrickColor.new("Beige") end end)
Someone could explain why it's not changing colors?
Set the BrickColor of the spawn not the spawn as a BrickColor
UserInputService = game:GetService("UserInputService") local Spawn1 = game.Workspace.SpawnLocation UserInputService.InputBegan:Connect(function(input, GameProcessedEvent) local RandomEvent = math.random(1,5) if input.KeyCode == Enum.KeyCode.E and RandomEvent == 1 then Spawn1.BrickColor = BrickColor.new("Really red") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 2 then Spawn1.BrickColor = BrickColor.new("Baby blue") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 3 then Spawn1.BrickColor= BrickColor.new("Gold") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 4 then Spawn1.BrickColor = BrickColor.new("Grey") end if input.KeyCode == Enum.KeyCode.E and RandomEvent == 1 then Spawn1.BrickColor = BrickColor.new("Beige") end end)