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

Concatenate string with Instance error?

The error 17:34:05.353 - Players.VitroxVox.PlayerGui.FlagCaptured.Frame.TextLabel.x:9: attempt to concatenate string with Instance

local flags = workspace:WaitForChild("Flags")
local tween = game:GetService("TweenService")

for _,f in pairs(flags:GetChildren()) do
	
	flags[f.Name].Holder.Changed:Connect(function()
		--print(f.Name.." Has been captured by Team "..f.Holder.Value)
		wait(2)
		script.Parent.Text = f.Name.." Has been captured by Team "..f.Holder.Value
		script.Parent.Visible = true
		wait(5)
		script.Parent.Text = ""
		script.Parent.Visible = false
	end)
	
end

So in short terms the "script.Parent" is a TextLabel the flags is a folder with models that are the "flags".

I'm really tired and I can't do it so please help, thank you!

1 comment

0

Your issue is on line 9 where you have f.Holder.Value, you should change it to f.Holder.Value.Name instead, since it's an Instance.

1 answer

You're trying to do "string"..Instance. To combat this just do "string"..Instance.Name since an instance's name is a string

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