PipeSader
(PipeSader)
January 17, 2021, 8:48pm
#1
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
Narunzo
(Narunzo)
January 17, 2021, 8:54pm
#2
You could set the player’s RespawnPoint
to a specific SpawnLocation
before using the :LoadCharacter
function.
2 Likes
PipeSader
(PipeSader)
January 17, 2021, 8:56pm
#3
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
xaoix00
(xao)
January 17, 2021, 8:56pm
#4
--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
PipeSader
(PipeSader)
January 17, 2021, 9:21pm
#5
How could i set the position?
player.Character:SetPrimaryPartCFrame(game.Workspace.Part)
is it good?
Narunzo
(Narunzo)
January 17, 2021, 9:30pm
#6
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.