I'm making it so when you click on a thing named Tool, it gets in your inventory. But this prints attempt to concatenate field 'Target' (a userdata value) and the wiki had no answers. Here is what I tried.
local Mouse = game.Players.LocalPlayer:GetMouse()
local Debounce = false
Mouse.Button1Down:connect(function()
if Mouse.Target ~= nil and Debounce == false then --checks if a part is clicked
script.ClickPart.Value = Mouse.Target
if script.ClickPart.Value == "Tool" then
print("Yay")
Debounce = true
local Inventory = script.Parent.Parent.Inventory
Instance.new("StringValue", Inventory.Things)
Inventory.Things.Value.Value = Mouse.Target
Inventory.Things.Value.Name = "Item"
wait(.35) --so they don't spam click
Debounce = false
end
end
end)
I thought you could do it, like how you can do this
print(game.Workspace.Baseplate.BrickColor.." is the colo(u)r of the baseplate!")
But this also prints another error! It says "attempt to concatenate field 'BrickColor' (a userdata value)". Why does it say it is a userdata value? But why can you do this?
print("The transparency of the baseplate is "..game.Workspace.Baseplate.Transparency)
I don't get it.

2 comments
I dont get what tostring does.
plus the problem is on line 6