Teleporting a player locally/only on the client side

For the final cutscene in my game, the player sits on a train with the main NPC. I wanted this to be something where it’s only you and the NPC, so all of the other players are invisible/you can’t see them. The problem is, I wanted to teleport the players locally, (so everyone, on their own clients, are visible and sitting down) which I don’t this is impossible but it’s definitely difficult. When testing alone, this works flawlessly, but when I do a team test it looks something like this:
image

(here’s the code for teleporting the actual player)

local endRouteGUI = game:GetService("ReplicatedStorage"):WaitForChild("endFinalRouteGUI")
local teleportPlayer = game:GetService("ReplicatedStorage"):WaitForChild("locallyTPplayer")
local tweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local seat = game.Workspace.finalRouteTrain.playerSeat
local playerPos = game.Workspace.LocationBlocks.finalRoutes.playerAboveSeat;

endRouteGUI.OnClientEvent:Connect(function(isFadeOut)
	
	local character = player.Character;
	character.Archivable = true;
	character.HumanoidRootPart.CFrame = playerPos.CFrame;

end)

I thought about making the other players invisible, but that wouldn’t work because one of the players pictured above isn’t sitting down, and they aren’t sitting on their client either. I tried cloning the character locally but that ended in disaster, the animate scripts somehow didn’t work , (although they did copy over) leaving the player stiff and unable to sit. What would you do in this situation?

Here’s a screenshot of what happens when I try to clone the player -
image
Here’s the local script I made for cloning the player (which still did not work) -

local endRouteGUI = game:GetService("ReplicatedStorage"):WaitForChild("endFinalRouteGUI")
local teleportPlayer = game:GetService("ReplicatedStorage"):WaitForChild("locallyTPplayer")
local tweenService = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local seat = game.Workspace.finalRouteTrain.playerSeat
local playerPos = game.Workspace.LocationBlocks.finalRoutes.playerAboveSeat;

endRouteGUI.OnClientEvent:Connect(function(isFadeOut)
	player.Character.Archivable = true;
	local localPlayerClone = player.Character:Clone();
	player.Character.Archivable = false;
	localPlayerClone.Name = "PLAYERCLONE";
	localPlayerClone.Parent = workspace["Random NPCS"];
	localPlayerClone.HumanoidRootPart.CFrame = playerPos.CFrame
end)

(P.S. i did cut out some of the code above just because this is a big script and a lot of the code is GUI-related so it might look a little weird why I’m getting so many services)

I would try to fix the issue you had with making the other players invisible as i believe that is the best way

2 Likes