Players.GEILER123456.Backpack.Tool.LocalScript:24: attempt to concatenate string with userdata

Hello! I’m trying to make a handcuff system. When a player clicks, I want it so that a ray checks if there is a character.
What is wrong with this?
It doesn’t print part…" - "…position.

local Cuff = script.Parent
local plr = game.Players.LocalPlayer
local char = plr.CharacterAdded:Wait()
local RS = game:GetService("ReplicatedStorage")
local Handle = Cuff.Handle
local mouse = plr:GetMouse()
local isEquipped = false


Cuff.Equipped:Connect(function()
	isEquipped = true
end)

Cuff.Unequipped:Connect(function()
	isEquipped = false
end)


mouse.Button1Down:Connect(function()
	if isEquipped then
		local ray = Ray.new(Handle.CFrame.p, (mouse.Hit.p - Handle.CFrame.p).unit * 300)
		print(ray)
		local part, position = workspace:FindPartOnRay(ray, plr.Character, false, true)
		print(part.." - "..position)
		
		
	end
end)

you should use tostring()
(30 charsss)

1 Like