https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online -- I read this and I am still having a hard time.
It works in studio but not online. There are no errors in the output.
function JustWelding (character)
local head = character.Head
local torso = character.Torso
script.Parent.CFrame = head.CFrame * CFrame.new(0,0,-5)
local weld = Instance.new("Weld")
weld.Part0 = torso
weld.C0 = torso.CFrame:inverse()
weld.Part1 = script.Parent
weld.C1 = script.Parent.CFrame:inverse()
wait()
weld.Parent = script.Parent
script.Parent.Anchored = false
end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(JustWelding)
end)
I tried to use WaitForChild but It didn't work. Maybe I did it wrong?

5 comments
Didn't work. Plus server log didn't say anything wrong.
What's the wait on line 10 for? Try removing that.
I don't know why but the wait makes the script work. Without it, the script wouldn't work at all. Hmm weird.
Sorry I didn't get the right answer then ;-;.
Thanks for trying!