I have placed comments on which code goes to server and which code goes to client.
Script:
local RemoteEvent = Instance.new("RemoteEvent", game.ReplicatedStorage)
--server
local Model = game.Workspace.MorphSaves.MorphNameHere
local Morph = Model:Clone()
Morph.Parent = workspace
Morph:MoveTo(player.Character.Torso.Position)
Morph.Name = player.Name
player.Character = Morph
RemoteEvent:FireClient(player)
LocalScript:
local remote = game.ReplicatedStorage:WaitForChild("RemoteEvent")
remote.OnClientEvent:Connect(function()
local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local human = char:WaitForChild("Humanoid")
if human then
workspace.CurrentCamera.CameraSubject = human
end
end)
How am I supposed to use the Morph variable in the local script when it was called in the server? When you defined the human variable you used Morph, which was created in the server script
I’ve ran into this problem before as well, here is my part of the script that works well. My guess is that you may have to wait for your character and the model to load before setting the Camera’s Subject/Type. If you haven’t done that then try it out but here’s an example of mine it’s similar;
Where is the Local Script located? Good places to place it would be StarterGui, or StarterPack. If it’s not even printing from line 1, then it’s either 1 of the 2 problems;
Have you checked to see if it’s parent will allow your script to run? (Parents of Instances only allow certain objects as children sometimes, and some are for storing instances which may be a reason of why your script doesn’t run)
Have you checked to see if it’s disabled? (Common mistake)