So, I was messing around and trying to weld a part to my characters head when I joined, but it didn't seem to work and there were no errors.
game.Players.ChildAdded:connect(function(hit)
local humanoid = hit:findFirstChild("Humanoid")
if humanoid then
local head = hit.Parent.Character.Head
local torso = hit.Parent.Character.Torso
script.Parent.CFrame = head.CFrame * CFrame.new(0,5,0)
local weld = Instance.new("Weld")
weld.Part0 = torso
weld.C0 = torso.CFrame:inverse()
weld.Part1 = script.Parent
weld.C1 = script.Parent.CFrame:inverse()
weld.Parent = script.Parent
script.Parent.Anchored = false
end
end)

1 comment
A good way to make sure they exist: use the WaitForChild method. For example
local humanoid = character:WaitForChild("Humanoid")