Attempt to concatenate Instance with String

Hi there, I’m finishing updating my plugin to add a create teleport system feature, but I’m struggling on one line:

image

Here is the plugin if needed: blisstools.rbxmx (346.6 KB)

Thank you in advance.

ptparent:FindFirstChild(part.Name).Name

Isn’t that just going to give the same error? I’ll try anyways

Yep, same error

image

I’m not sure why you’re trying to find an instance via its name in order to index its name property, you could just replace the entire thing with ..part.Name.. instead.

This causes an error I believe anyways.

try putting part.Name into tostring()

Because your concentrating a string with an instance like

instance…string

you need a string-valid type

@Forummer error this causes

image

That’s an entirely different portion of the script.

That part has to work as well, and by changing that, it causes the plugin to no longer error, but the script errors instead.

Just been told about part:GetFullName(), so I’m going to try that

An instances name property should be a string value, your error likely stems from some other string concatenation attempt.

Why would “:GetFullName()” change anything? That’s essentially the same as indexing the instances name property but it provides the instances path as well (name of ancestors).

I needed the instance’s path for this, so players can teleport to the part

part:GetFullName() does seem to work fully though.

You just need a reference to the instance for that, not the entire path.

For clarity, would you mind sharing the entire string concatenation portion?

I’ve already made it work with part:GetFullName(), that section of the script was the only section that needed to use concatenation

There’s code missing from the provided screenshot & it would be helpful to users facing a similar issue.

I posted the entire’s plugin code lol

local tppart = ptparent:FindFirstChild(part.Name) 
[[
	script.Parent.Activated:Connect(function()
	local plrs = game:GetService("Players")
	local tp = tppart
	local tplocation = CFrame.new(tp.CFrame.X, tp.CFrame.Y + 5, tp.CFrame.Z)
	plrs.LocalPlayer.Character:SetPrimaryPartCFrame(tplocation)
	script.Parent.Parent.Parent.Visible = false
	end)
]]

Fairly obvious what the issue was with the full source code.

1 Like