How to use player:LoadCharacter with position

Hello! I would like to know how to use ‘player: Load Character’ indicating a specific position on the map where a part will be.

Example, the player will press a button and ‘player: Load Character’ will be executed in the position where a part is.

Could someone help me with that, please?

script.Parent.Parent.BackNormal.MouseButton1Click:Connect(function()

game.Players.CharacterAutoLoads = false

end)
3 Likes

You could set the player’s RespawnPoint to a specific SpawnLocation before using the :LoadCharacter function.

2 Likes

I don’t want to use a spawn location, I just want the player to load in a specific place where a part will be :frowning:

--Player.LoadCharacter() can't be called on client, if it's a local script make it server script
game.Players.PlayerAdded:Connect(function(player)
 local gui = player:WaitForChild("PlayerGui")
 --here do path to the button
 gui.Path.MouseButton1Click:Connect(function()
  player:LoadCharacter()
  player.Character:SetPrimaryPartCFrame(TheCFrameOfThePartYouWantThePlayerToSpawnAt)
 end)
end)
3 Likes

How could i set the position?

player.Character:SetPrimaryPartCFrame(game.Workspace.Part)

is it good?

That would error, it has to be a CFrame not a part.
You would need to do.
*game.workspace.Part.CFrame
to get the CFrame of a part though.