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

Most efficent way to make color arrows?

Asked by 9 years ago

I am trying to make a simpler way to navigate with two arrows, one going forward a color and the other going to the previous color. I have this but it is too long and unefficent.

script.Parent.MouseButton1Down:connect(function()
if script.Parent.Parent.Num.Value==1 then
script.Paren.Parent.ColorValue=255,255,0
script.Parent.Parent.Num.Value=2
end
if script.Parent.Parent.Num.Value==2 then
script.Paren.Parent.ColorValue=0,255,0
script.Parent.Parent.Num.Value=3
end
if script.Parent.Parent.Num.Value==3 then
script.Paren.Parent.ColorValue=0,255,0
script.Parent.Parent.Num.Value=4
end
end

I also tried creating a table but I dont know what to do after this to make both buttons working.

local colors = {
    ["Red"] = "255, 0, 0",
    ["Green"] = "0, 170, 0",
    ["Blue"] = "0, 85, 255",
    ["Purple"] = "0, 0, 255",
    ["Yellow"] = "255, 255, 0",
    ["Black"] = "0, 0, 0",
    ["White"] = "255, 255, 255",
}

Also the two arrows are in player gui and their is two values, one named num and the other named colorvalue.

0
bump :) haydebug2003 -5 — 9y
0
Commenting does not bump up your question's relevancy. Unclear 1776 — 9y

Answer this question