Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Player keeps reseting?

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?

3 comments

0

Try to add chracterbod:MakeJoints() somewhere.

0

Thanks for a clue. Ima try it

0

Didn't work out so well..

1 answer

✓ Accepted answer

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.

6 comments

0

When should I define joints?

0

Right as you parent it to Workspace, for example.

1

You could potentially try to parent player.Character to nil rather than setting it to nil, then set player.Character to characterbod. This should prevent respawning.

0

Your amazing! I would give something, but how do that to someone who gots everything?!

0

Didn't work...

0

Ima need more help cause it isnt work but thanks raven.

This discussion is preserved as it was. New answers, comments, and votes are closed.