This is part of a script I created...
01 | function createLeaderboard() |
02 | iframe = Instance.new( "Frame" , script.Parent.Game) |
03 | iframe.Name = "IFrame" |
04 | iframe.Size = UDim 2. new( 0.3 , 0 , 0.5 , 0 ) |
05 | iframe.Position = UDim 2. new( 0.5 , 0 , 0.5 , 0 ) |
06 | iframe.BackgroundTransparency = 1 |
07 | mframe = Instance.new( "Frame" , iframe) |
08 | mframe.Name = "MFrame" |
09 | mframe.BackgroundColor 3 = Color 3. new( 102 , 0 , 0 ) |
10 | mframe.BorderSizePixel = 5 |
11 | mframe.BorderColor 3 = Color 3. new( 255 , 0 , 0 ) |
12 | mframe.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
13 | mframe.Position = UDim 2. new(- 0.5 , 0 ,- 0.5 , 0 ) |
14 | end |
The problem is when i play solo or online the colors aren't set to what i set them to... they change to:
BackgroundColor3 = 26010, 0, 0 ---- BorderColor3 = 5025, 0, 0
--EDIT-- FULL SCRIPT:
01 | local player = game.Players.LocalPlayer |
02 | local mouse = player:GetMouse() |
03 |
04 | function createLeaderboard() |
05 | iframe = Instance.new( "Frame" , script.Parent.Game) |
06 | iframe.Name = "IFrame" |
07 | iframe.Size = UDim 2. new( 0.3 , 0 , 0.5 , 0 ) |
08 | iframe.Position = UDim 2. new( 0.5 , 0 , 0.5 , 0 ) |
09 | iframe.BackgroundTransparency = 1 |
10 | mframe = Instance.new( "Frame" , iframe) |
11 | mframe.Name = "MFrame" |
12 | mframe.BackgroundColor 3 = Color 3. new( 102 , 0 , 0 ) |
13 | mframe.BorderSizePixel = 5 |
14 | mframe.BorderColor 3 = Color 3. new( 255 , 0 , 0 ) |
15 | mframe.Size = UDim 2. new( 1 , 0 , 1 , 0 ) |
Color values range from 0 - 255
, but when you use them in a Color3, they range from 0 - 1
. Intead of saying Color3.new(255,0,0)
, you have to say Color3.new(1,0,0)
. Basically divide every color value in the Color3 by 255.
1 | local R = 255 |
2 | local G = 0 |
3 | local B = 0 |
4 | NewColor = Color 3. new(R / 255 , G / 255 , B / 255 ) |
Hope this helped!
Note: When you say Color3.new(102,0,0)
, it should actually be Color3.new(102/255,0,0)