I'm trying to make a text that's on a surface GUI change to whatever the integer value is, but it doesn't change at all.
local text = script.Parent.Text local val = script.Parent.Value.Value text = ""..val
Thanks if you can help.
You need to add an event so it fires and runs the code.
local text = script.Parent.Text local val = script.Parent.Value val.Changed:connect(function() --Fires when the value changes text = val.Value --Sets the text to the value end)
This is because you are setting your variables to the VALUE of the property, not the property itself.
The variable is set to the value of the property at the time, so instead of adding a .Value or a .Text remove it.
Do this instead:
local text = script.Parent local val = script.Parent.Value text.Text = tostring(val) -- we will preset the value. val.Changed:Connect(function() -- Put this in a changed event so it runs when the value changes. text.Text = tostring(val) end)