Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Player keeps reseting?

Asked by 10 years ago
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?

0
Try to add chracterbod:MakeJoints() somewhere. Relatch 550 — 10y
0
Thanks for a clue. Ima try it ApolloTalentz 20 — 10y
0
Didn't work out so well.. ApolloTalentz 20 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

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.

0
When should I define joints? ApolloTalentz 20 — 10y
0
Right as you parent it to Workspace, for example. Ravenshield 180 — 10y
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. Ravenshield 180 — 10y
0
Your amazing! I would give something, but how do that to someone who gots everything?! ApolloTalentz 20 — 10y
View all comments (2 more)
0
Didn't work... ApolloTalentz 20 — 10y
0
Ima need more help cause it isnt work but thanks raven. ApolloTalentz 20 — 10y
Ad

Answer this question