Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

bad argument #3 to 'Text' (string expected, got nil) For Max And Min Values?

I am having a very hard time Trying to solve this error, I can't get this to function correctly, What am i doing wrong? And What needs to be fixed?

WeatherDropDownLower.DropDownMenuButton.Text = Weathers[WRX_R.Settings.WeatherBounds.MinValue]

WeatherDropDownUpper.DropDownMenuButton.Text = Weathers[WRX_R.Settings.WeatherBounds.MaxValue]

2 comments

0

It seems like you are using a double constrained value, if you are i advise you to use another method as it is deprecated

0

Oh alright

2 answers

✓ Accepted answer
WeatherDropDownLower.DropDownMenuButton.Text = tostring(Weathers[WRX_R.Settings.WeatherBounds.MinValue])

WeatherDropDownUpper.DropDownMenuButton.Text = tostring(Weathers[WRX_R.Settings.WeatherBounds.MaxValue])

4 comments

0

As "MaxValue" is most likely an IntValue or NumberValue it would be required to put ".Value" at the and and also I don't see point answering question when that answer has been already given before.

0

Yeah, you're just spoonfeeding.

0

Wow, This actually works...Thanks! And What does tostring does?

0

I don't really see how I'm spoonfeeding, I simply just put the answer into context incase they didn't understand, and tostring attempts to convert the given value to a string

You cant set objest as text. Use tostring (this is one fix but if error says that it's nill it may be because that value doesn't exists or you didn't locate it good) and .Value at th end.

WeatherDropDownLower.DropDownMenuButton.Text = tostring(Weathers[WRX_R.Settings.WeatherBounds.MinValue.Value])
~~~~~~~~~~~~~~~~

Note: for some reason lua block on phone is not working so sorry about that

This discussion is preserved as it was. New answers, comments, and votes are closed.