I am creating a system in which when one part is clicked, a second part moves to a position in which it is behind the player no matter where they click the part from
This works, but it would only work for me because my script finds the first child by my username
local part = game.Workspace.ClickPart
local brick = script.Parent
part.ClickDetector.MouseClick:Connect(function(hit)
local Torso = game.Workspace:FindFirstChild("tnouf2").Torso
brick.Position = Torso.Position - Torso.CFrame.lookVector + Vector3.new(0,0,-3)
end)
(script is inside of the part that spawns behind you)
Does anybody know how to make line 5 work for any player, and not just myself?