Help making custom character morphs

I looked at it but I’m not sure I get what it does. Is all of that script going into the server?

nvm I think I figured it out. the bottom part goes in a local script?

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)
1 Like

Yes. The bottom part goes in a localscript, as you cannot manipulate Camera via Server. @TheIMevolved Any luck?

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

Edited it, did not mean to write Morph :stuck_out_tongue:

Now it’s throwing a “MoveTo is not a valid member of Folder” error :thinking:

Could you possibly show the hiearchy (layout) of the workspace?

oh nvm I got it. Forgot I put the morph in a folder :sweat_smile:

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;

if humanoid then

camera.CameraType = "Scriptable"

wait()

camera.CameraSubject = humanoid

camera.CameraType = "Custom"

end

Have you fixed it? (Just asking because you said it was in the folder, but I don’t know if you meant you fixed it or not)

Just tested with some prints, the local script isn’t even firing at all :thinking:

Can you send us the hierarchy of the client script?

If the localScript isn’t running, try putting it in StarterGui

ayyy that worked, thanks a lot :grin:

1 Like

Make sure you mark a solution then!

Were even was the localScript?

StarterPlayerScripts

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;

  1. 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)

  2. Have you checked to see if it’s disabled? (Common mistake)

He changed the location to StarterGui, and it worked, hence the marked solution.

For anyone curious what the solution was in more detail, the localScript was place in StarterPlayer (Red) instead of StarterPlayerScripts (Green)
image

1 Like