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

[SOLVED] This color script wont work ImageColor3 for a GUI..?

Asked by 5 years ago
Edited 5 years ago

Im using a local script, should I be? Trying to change the image colour on click... it should be working?

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Parent.ImageColor3 = ("41, 255, 137")
end)

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Firstly, ImageColor3 doesn't accept the way you put the values ("41, 255, 137"), it accepts a type of value called Color3.

You don't use strings to express Color3 values, you use numbers instead:

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Visible = false
    script.Parent.Parent.Parent.ImageColor3 = Color3.new(41, 255, 137)
end)

Here's a bit more of information about your question: https://developer.roblox.com/en-us/api-reference/property/ImageLabel/ImageColor3

And yes, you use local scripts to show stuff that a single player should see, such as guis. Hope i helped, and if i did, please click the accept answer button.

(sorry if i was unclear, i'm terrible at explaining stuff)

0
Thanks. killerbrasko2002 33 — 5y
0
No problem. User#27525 1 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Solved, I used a diffrent way... Using 2 images as roblox wiki suggests.https://developer.roblox.com/en-us/articles/Creating-GUI-Buttons

Answer this question