Textstring in properties changing but not on view?

It’s hard to explain what I’m actually trying to achieve.
I’ve made a simple local script, checking if a stringvalue has a certain string in it. If it contains that string. It’ll change the text of a textlabel.

But for some reason, the text doesn’t change, even though it changes in the properties tab.

Here’s the script:

local clsv = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("ClassV")

local classtxt = script.Parent.Class
	

if clsv.Value == "eco" then
		classtxt.Text = "EC"
end

if clsv.Value == "comf" then
		classtxt.Text = "CF"
end

if clsv.Value == "deluxe" then
	classtxt.Text = "DX"
end

Thank you for coming along this far, I’d hope you could help me with this.

This will only run on execution and only once because of the scope of those checks, it wont run anytime the text is changed. You need some sort of event (ValueChanged or something) or Module to make this run when you want to change the text. And you will have to encapsulate the text checking inside a function so that it can be run whenever required.

Like this (pseudo as is untested):

-- shudder at such long path dependencies, there must be a better way than this!
local clsv = script.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("ClassV");
local classtxt = script.Parent.Class;
	
local function checkText(newValue)

	if newValue == "eco" then
		classtxt.Text = "EC";
	elseif newValue == "comf" then
		classtxt.Text = "CF"
	elseif clsv.Value == "deluxe" then
		classtxt.Text = "DX"
	end
end

clsv.Changed:Connect(function(NewValue)
      checkText(NewValue);
end)

-- if you want it to run on execution then call the function here once from outside any scope
checkText(clsv.Value);

Well, there’s still the same issue, It doesn’t work.

Is that path dependency pointing to StarterGui or the copy that gets made into Players->“player name”->PlayerGui, it might also depend where your script is running from, that path might not point to the same place when its been copied there…

The LocalScript under the “ChangeAble” folder is where that piece of script is located in.