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

Why does these values not change?

Asked by 5 years ago
Edited 5 years ago

I'm working on a Morphroom with a GUI that allows for the player to input a custom VertexColor. The issue now is that the Values arnt changing.

In studio I've manually changed R,G,B to see if the whole script works. It does somewhat except the values arnt changing.

Display.Click.MouseClick:Connect(function(player)
    local HairColor = player.DATA_.HairColor
    local R = HairColor.Red.Value
    local G = HairColor.Green.Value
    local B = HairColor.Blue.Value
    local colorstring = tostring(Vector3.new(R,G,B))

    print(colorstring)
    Display.SurfaceGui.Vertex.Text = tostring(Vector3.new(R,G,B))
end)

It keeps coming out as 1,1,1 even if I changed R,G, or B. Is there something I'm doing wrong or missing?

0
Why are you using Vector3.new on the color values? 1TheNoobestNoob 717 — 5y
0
Its for the meshes. The hairs have a translucent texture so I just have to change the Vertex Color instead of having a bunch of different textures for different colors. BlauKitten 88 — 5y
0
It works for me. What is printing out for the line "print(colorstring)"? What happens when you hardcode the values with R= 0.3, G = 0.3, B = 0.5? Cousin_Potato 129 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

The issue is that studio play mode now enforces filtering enabled. So, the server is not counting the changes you made as valid. If that is not the issue, the only other thing I can think of is that a click detector cannot be used with a GUI. Try using something like the Button1Down event to see when a player clicked the GUI. Note: If you are using a GUI, use a LocalScript. If you need to connect with the server use remote events/functions. There is no excuse for not using a LocalScript in a GUI.

Ad

Answer this question