Help in troubleshooting

Okay, so this is one script used in a billboard so it finds the text in the current visible display frame (using variables controlled by another script), and then localises the user-custom textlabel name and modifies its text to display the time left before changing frames. However, I’m getting the error “Attempt to concatenate string with instance” on lane 9 (the longest line, if you wonder)


while true do
	local dispnum = script.Parent.Parent.Functions.Display
	local countdown = script.Parent.Parent.Functions.Countdown
	local location = script.Parent.Parent.Configs.Location
	local name = script.Parent.Parent.Configs.Name
	local display = script.Parent.Parent	
		
	display[name .. dispnum][location.Value].Text = "Next Page in "..countdown.Value.." Second(s)"
	wait(1)
end
2 Likes

This line is probably the issue. The variable dispnum is probably an Instance, which will cause the error. It’s not clear in the post what kind of Instance it is, but if it is a Value, you need to use dispnum.Value, or if you want to use it’s name, you would need to do dispnum.Name. Either way, you need to change it to a string.

1 Like

The Dispnum value is Numeric
The Name value is an Int
The Location value is also an Int

I am getting now Nil with Number, for your info, this is the Name’s origin:

local Name = Instance.new("IntValue")
Name.Parent = Configs
Name.Name = "Name"
Name.Value = name (this comes from a variable in that script)

When i try to adress the value byte, char etc, show up…

changed:

display[name.Value .. dispnum.Value][location.Value].Text = "Next Page in "..countdown.Value.." Second(s)"
1 Like

Does the changed version work?

Sadly no, returns the same error but now with: “Nil to Number”, which is quite odd, since Location (another Int value like Name) returns .Value, meanwhile Name seems to not even let to. All of the values are made as instances by a script, and they are indentical except for the names and given value.

1 Like

I believe your name variable might actually refer to the property Name(a string), and not a child named “Name”, which means it will error when attempting to do string.Value. In case name is a StringValue parented to Configs, you could replace the name line with this:

local name = script.Parent.Parent.Configs:FindFirstChild("Name")
1 Like

Yep, seems so that the mistake was using Integers rather Strings. It also was the name, whereas your solution works, so that’s completely an option. Thank you for helping!

1 Like

Oh, no, it’s perfectly fine to concatenate a string and an integer.

1 Like

Sorry, I accidentally chose Integers rather strings, since the values we work on were strings, if I haven’t changed that, it pops up with an error saying “01” isn’t a valid location.

(My apologies, lol)

1 Like

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