Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why wont my selection box color3 script work?

I have a selection box with a part and i can see the selection box, in there is script saying:

i = (255 - (script.Parent.Parent.Bag.clicks.Value * 12))

  

while true do

script.Parent.Color3 = Color3.new(150,255,i)

wait()

end

and i also just tried:

--i = (255 - (script.Parent.Parent.Bag.clicks.Value * 12))

  

--while true do

script.Parent.Color3 = Color3.new(150,255,255)

--wait()

--end

But the color3 (i checked manually) says : 38250, 65025, 65025, those are all more than 255 and HOW DOES THAT HAPPEN!?!??!? i completely took away script and its normal, so obviously the color3 thing is not working correctly, how do i fix this? thanks :)

4 comments

0

Selection box? What do you mean?

1

Color3.new() only uses numbers ranging from 0-1. Use Color3.fromRGB() instead, as that uses numbers from 0-255. Also, selection boxes are what give parts outlines, like how you see a blue outline on a part you select in studio.

0

you might wanna turn that comment to an answer because it works, and you know what that means, i can mark ur answer as answered.

1

^ That SelectionBox explanation was for Gameplay28, not you. An upvote on my comment is all I need. ^_^

1 answer

✓ Accepted answer

You have to use Color3.fromRGB() instead of Color3.new()

Color3.new() uses 0 -> 1 Color3.fromRGB() uses 0 -> 255

This discussion is preserved as it was. New answers, comments, and votes are closed.