Welding when Player Joins won't Work?
I am trying to weld a part to a player when they join the game, but it only happens to one person. Unless starting servers from roblox studio is messed up, because I put 2 players in, and on Player 2's screen, Player 1 has the part welded to him, but Player 2 doesn't. Then if I go onto Player 1's screen, none of them have it. Plus I look at the server window and in the output it says "An error occurred" Here is the script:
01 | local function weldBetween(a, b) |
03 | local weld = Instance.new( "ManualWeld" , a) |
06 | weld.C 0 = b.CFrame:inverse() * b.CFrame |
07 | a.LocalTransparencyModifier = 0 |
12 | game.Players.PlayerAdded:connect( function (plr) |
13 | plr.CharacterAdded:connect( function (chr) |
14 | local part = Instance.new( "Part" , game.Workspace) |
15 | part.Name = "Welded Part" |
16 | part.Size = Vector 3. new( 2 , 2 , 2 ) |
17 | local weld = weldBetween(part, chr.Torso) |