game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local characterbod = game.ReplicatedStorage.Test:Clone() characterbod.Name = player.Name.."Test" characterbod.Parent = workspace characterbod:MoveTo(workspace.Part.Position) local cam = workspace.CurrentCamera cam.CameraSubject = characterbod.Humanoid player.Character = nil player.Character = characterbod characterbod:MakeJoints() characterbod.Animate.Disabled = false end) end)
I want the play to be given a special body.
The player is given the appropriate body but then respawns. The original character exist as well. This cycle repeats as long as the player is in the server.
Here is the place where you can see what happens. To my place
Newer Version:
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local characterbod = game.ReplicatedStorage.Test:Clone() characterbod.Name = player.Name.."Test" characterbod.Parent = workspace characterbod:MakeJoints() characterbod:MoveTo(workspace.Part.Position) local cam = workspace.CurrentCamera cam.CameraSubject = characterbod.Humanoid player.Character.Parent = nil player.Character = characterbod characterbod.Animate.Disabled = false end) end)
Does it matter what script it is in?
You have to establish the joints before you assign it to the Player, else it'll theoretically be dead upon assigning it - hence why the player respawns.