Unable to assign property Text. string expected, got nil (for plugin:getSetting())

Hello, I was trying to assign Text to a plugin:getSetting() value, but Unable to assign property Text. string expected, got nil error showed up. I wonder what went wrong.


Script:

local WELCOME = "WELCOME"
Welcome.Input.Text = plugin:GetSetting(WELCOME)

This is just a concept of a script, but works exactly the same way.


Thanks!

1 Like

The error tells you exactly what went wrong. The value you tried to assign to the text property is nil, so the result of plugin:GetSetting(WELCOME) was nil.

1 Like

How would I fix that, as I did set it to "WELCOME"?

1 Like

Just because the input value of the function was a string, doesn’t mean the output value must be. Check the documentation, it should tell in what case the function would return nil.

1 Like

Try this maybe?

Welcome.Input.Text = plugin:GetSetting("WELCOME")

Busy rn

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.