So i want to make a script when u can control an another character and be able to return to his first body after .
Here my local script :
local UIS = game:GetService(“UserInputService”)
local camera = workspace.Camera
local chararcter = game.Players.LocalPlayer.Character
local Player = game.Players.LocalPlayerUIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.F then
local titan = workspace.DataKenny
game.ReplicatedStorage.Shifter:FireServer(“On”)
camera.CameraSubject = titan
end
end)
UIS.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.R then
game.ReplicatedStorage.Shifter:FireServer(“Off”)
camera.CameraSubject = workspace.CloneShifter:FindFirstChild(Player.Name)
workspace.CloneShifter:FindFirstChild(Player.Name).Humanoid.NameDisplayDistance = 0
end
end)
And here my Server
l> ocal ClonedPlayer
game.ReplicatedStorage.Shifter.OnServerEvent:Connect(function(player,State)
if State == “On” then
local titan = workspace.DataKenny
player.Character.Archivable = true
local ClonePlayer = player.Character:Clone()
player.Character.Archivable = falseplayer.Character = titan
ClonePlayer.Parent = workspace.CloneShifterelseif State == “Off” then
local ClonedPlayer = workspace.CloneShifter:WaitForChild(player.Name)
player.Character = ClonedPlayer
ClonedPlayer.Archivable = false
player.Character.Parent = workspace
end
end)
Its working but i got some problem like when u return to your last body u can see ur name and its weird its not like when u spawn :c