What do you want to achieve? I want it so my character refreshes without reseting the camera and keeping the current location of the player so it doesn’t go back to spawn
What is the issue? I don’t know how to do it
What solutions have you tried so far? I looked on the dev forum
game.Players.PlayerAdded:Connect(function(plr)
while true do
plr:LoadCharacter()
wait(0.1)
end
end)
i know it’s not the best but i don’t know how i would do it otherwise
Well, that’s related to you spamming the LoadCharacter function, may I ask what you’re trying to achieve? Is it teleporting the player back to where they died?
The only way I can think of is to cache the player’s position and then call :LoadCharacter(), and after they respawn and are teleported to a spawn point, you would just move them back to whatever cache you had stored.
This is probably going to be annoying to do without a custom spawn system.
You can achieve this with GetHumanoidDescriptionFromUserId and then just apply the newest description to the humanoid
local desc = game.Players:GetHumanoidDescriptionFromUserId(plr.UserId)
local character = plr.Character
if character then
character.Humanoid:ApplyDescription(desc)
end