player = game.Players.LocalPlayer
character = player.Character
mouse = player:GetMouse()
script.Parent.Equipped:connect(function()
mouse.Button1Down:connect(function(click)
local distance = (character.Torso.CFrame.p - click.Torso.CFrame.p).magnitude
if click:FindFirstChild("Humanoid") and click:FindFirstChild("Torso") then
if distance < 21 then
click.Torso.CFrame = CFrame.new(workspace.prison.Position)
end
end
end)
end)
when i click on something that has a humanoid and a torso it keeps on saying this in the output:
16:34:14.292 - Players.EXpodo1234ALT.Backpack.Handcuffs.LocalScript:7: attempt to index local 'click' (a nil value)

1 comment
I don't see no targetChar variable