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

No error in output, but yet the color doesn't change as its support to?

Asked by 7 years ago
script.Parent.MouseButton1Click:connect(function()
game.StarterGui.KeemTroll2.Main.cmds.BackgroundColor3 = Color3.new (24, 255, 62)
end)

What is wrong with this? Please fix this... Output: Nothing lmao

0
with color3 you need to write it as a fraction for the values, it would be Color3.new(24/255,255/255,62/255) QuantumToast 261 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

Well, you didn't provide too much info but I think I see the issue. You're doing:

game.StarterGui.KeemTroll2.Main.cmds.BackgroundColor3 = Color3.new (24, 255, 62)

That won't work because a Color3.new() value ranges from 0 to 1. Here's your issue solved:

game.StarterGui.KeemTroll2.Main.cmds.BackgroundColor3 = Color3.fromRGB (24, 255, 62)

Hope I helped! :)

Ad
Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
7 years ago
Edited 7 years ago

Astreal is correct, but you have another problem. You're making your changes to the gui in StarterGui.

StarterGui isn't actually what the player is seeing, it is merely a container to store guis, which later get cloned into the PlayerGui. The gui in the PlayerGui is what your players are seeing. They won't see any changes made to the objects in StarterGui until they respawn.

So basically, make your changes to the guis in the PlayerGui. It's hard to give code because I don't know your hierarchy, but it'll be something like this:

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Parent.cmds.BackgroundColor3 = Color3.fromRGB(24, 255, 62)
end)

Answer this question