ive tried multiple times to make something weld above the players head when he spawns into the game but i just cant figure it out
ive got a union saved in the serverstorage and it is supposed to clone with and then the clone gets welded above the players head
one of my several attempts:
function playerAdded(player) local clone = game.ServerStorage.Crystal:Clone() local player = game.Players.PlayerAdded head = player.Humanoid.Head clone.CFrame = head.CFrame * CFrame.new(0,3,0) weld = Instance.new("Weld") weld.Part0 = head weld.C0 = head.CFrame:inverse() weld.Part1 = clone weld.C1 = clone:inverse() weld.Parent = clone end game.Players.PlayerAdded:connect(playerAdded)
line 5 and 7 are the errors
if there is more information needed feel free to comment
TheLuckyZ is right: "You don't need line 3, as player is already defined in the function's parameters. Line 5 should be head player.Character.Head." You will also need to wait for the character to spawn because the character spawns a little AFTER the player is added to the game. This is why your script couldn't find the character. You can use WaitForChild to yield the script until the character is found such as:
character = workspace:WaitForChild(player.Name) head = character:WaitForChild("Head")
Then work with the head.
You don't need line 3, as player is already defined in the function's parameters. Line 5 should be head player.Character.Head.