Hey. I have a part that moves a model from replicated storage to workspace. The model has a part that should change a String Value when clicked and it does but for some reason the script that should update a text label's text doesn't work. Here's the code:
local case = game.Workspace:WaitForChild(script.Parent.Parent.CasesGui.Case.Value) local deduction = case:WaitForChild("Deduction").Value while true do wait() if case and deduction then if deduction == "Identification" then script.Parent.TextLabel.Text = "This is definetly a broken part from the stolen server" script.Parent.TextLabel.TextColor3 = Color3.new(234, 255, 0) elseif deduction == "Type" then script.Parent.TextLabel.Text = "From the bending and the feeling of this... This is Aluminum" end end end
You shouldn't write Value
in a variable do it like this and see if it works.
local case = game.Workspace:WaitForChild(script.Parent.Parent.CasesGui.Case) local deduction = case:WaitForChild("Deduction") while true do wait() if case.Value and deduction.Value then if deduction.Value == "Identification" then script.Parent.TextLabel.Text = "This is definetly a broken part from the stolen server" script.Parent.TextLabel.TextColor3 = Color3.new(234, 255, 0) elseif deduction.Value == "Type" then script.Parent.TextLabel.Text = "From the bending and the feeling of this... This is Aluminum" end end end
Update on this. I made this FE so I couldn't just update the Text from a normal script. I had to do it from the local script that defines what the event does when it's triggered.