I'm trying to make it so after a client has been fired and the screen fades out, the player moves to a different position before fading back in. I figured out how to make a fade but the moving player i'm having trouble with. I've used many different scripts but none seem to be working.
I'm using a local script that is placed inside the PlayerGUI.
If anyone could help that would be great!
This will teleport the player after re-spawning to 0,100,0. Just tested, works for me.
01 | local Players = game:GetService( "Players" ) |
02 | local RunService = game:GetService( "RunService" ) |
03 |
04 | local function onCharacterAdded(character) |
05 | local player = Players:GetPlayerFromCharacter(character) |
06 | -- Teleport the player there when their HumanoidRootPart is available |
07 | local hrp = character:WaitForChild( "HumanoidRootPart" ) |
08 | -- Wait a brief moment before teleporting, as Roblox will teleport the |
09 | -- player to their designated SpawnLocation (which we will override) |
10 | RunService.Stepped:wait() |
11 | hrp.CFrame = CFrame.new( Vector 3. new( 0 , 100 , 0 )) |
12 | end |
13 |
14 | local function onPlayerAdded(player) |
15 | player.CharacterAdded:Connect(onCharacterAdded) |
16 | end |
17 |
18 | Players.PlayerAdded:Connect(onPlayerAdded) |
Read more at Developer wiki, here