Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont my selection box color3 script work?

Asked by 5 years ago

This question has been solved by the original poster.

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 :)

0
Selection box? What do you mean? Gameplay28 139 — 5y
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. User#20279 0 — 5y
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. CommanderCaubunsia 126 — 5y
1
^ That SelectionBox explanation was for Gameplay28, not you. An upvote on my comment is all I need. ^_^ User#20279 0 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

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

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

Ad

Answer this question