I'm trying to have a tooltip script that displays a player's name in a GUI when another player hover's their mouse over them, and have red text when it's an enemy player, but apparently Color3.new()
doesn't work for TextColor3. So, does anyone know how this line should be rewritten?:
TextLabel.TextColor3 = Color3.new(255, 254, 205)
You would use Color3.new
, but the R, G, and B values in Color3.new
range from 0 - 1. Basically, you would write your code like this:
TextLabel.TextColor3 = Color3.new(255/255, 254/255,205/255) --It's dividing the numbers by 255 to scale the value to a number between 0 and 1
If you have a lot of Color3
values you need to put in your code, you can paste this code at the top of your script to be able to use a 0-255 range.
local _Color3 = Color3 local Color3 = { new = function(r, g, b) return _Color3.new(r/255, g/255, b/255) end } TextLabel.TextColor3 = Color3.new(25, 50, 75)