Why does my remoteevent only fires once when I called it twice?

hey, I’m trying to make a “smooth” character morph, but it isn’t really working properly

--normal script
morph:FireClient(player, 1) --first remoteevent call
    
player.Character = morph_char
    
if playerRoot and cloneRoot then
  local playerRoot_CFrame = playerRoot.CFrame
        
  playerRoot.CFrame = cloneRoot.CFrame
  cloneRoot.CFrame = playerRoot_CFrame
  print("morphed")
else
  warn("Player not able to be morphed")
end
    
morph_char.Parent = workspace
morph:FireClient(player, 2) --second remoteevent call
character:Destroy()
--local script
local tool = script.Parent

local morph = tool:WaitForChild("morph")

local camera = workspace.CurrentCamera
local angle = nil

morph.OnClientEvent:Connect(function(func)
    print("fired")
    
    if func == 1 then
        angle = camera.CFrame
        print(angle)
    elseif func == 2 then
        camera.CFrame = angle
        print("changed!")
    end
end)

not sure why this is happening, could anyone help me out?
thanks in advance! :slight_smile:

What part of your code has worked so far? Im confused why you’ve set the playerRoot_CFrame to playerRoot.CFrame whats that do, also why have you set the morphChar.Parent to the workspace after you set the players character? Also whats the goal? Why have you put the morph client script in a tool?

The whole code works except the second remoteevent call

playerRoot_CFrame is the hrp’s CFrame, which makes the new character be at the same position before morphing

so the character will be set before parenting to workspace, idk tho

to make the player’s camera be at the same CFrame so it looks like it smoothly switched

it honestly makes no difference if it’s in starterplayerscripts

Its good practice to put scripts in starterplayerscripts it makes no sense for the player to have a random tool that doesn’t function, its also better for later if you need to edit the script so you dont need to go through loads of tools to find the right script.

It could be that its not working because if you have the tool equipped when the event is fired then your character would have changed and would not have passed on the tool with the local script - which is why you should keep them in starterplayerscripts.

alright, I’ll try to put my local script in sps, thanks!

nevermind I was wrong, it works after I put it in sps, but now I’m trying to set the CFrame of my camera in the Custom cameratype, which isn’t going very well.
Could you help me out?

When you set the camera cframe you need to set the camera type to be scriptable:

Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = -- your cframe here

but I want the camera to still move around, not be completely stuck