Greetings! I have asked this question before, but I might as well give it another shot, reword a few things, and clear up some points I may have confused some people on in my original post.
The purpose of this script is to receive morph/character data from a place and use that data to "remorph" the player back to the character they were previously playing. Almost everything is working! Almost.
Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character
Character:WaitForChild("Humanoid")
wait(1.0)
local teleport = game:GetService("TeleportService")
local teleportdata = teleport:GetLocalPlayerTeleportData()
if teleportdata then
print(teleportdata.charName)
print(teleportdata.charClass)
print(teleportdata.offset)
local char = (teleportdata.char)
end
char = (teleportdata.char .. 'Morph')
offset = teleportdata.offset
script.parent.TextLabel.Text = (char)
wait(0.5)
Player.Character.Humanoid.CameraOffset = Vector3.new(offset)
print("Camera Offset")
wait(0.5)
if char == "NullDefaultMorph" then
print("No Morph!")
else
game.Workspace.MorphFuncs.PlayerClear:FireServer()
print("Clear Player")
game.Workspace.MorphFuncs:WaitForChild((char)):FireServer()
print("Player Morph")
end
Line 19 is the culprit here. I have token advice from others to use print() to see if something would pop up, but nothing. ROBLOX Studio reports no errors, the in-game console reports no errors, and yet, the Player CameraOffset does not change at all. It's as if it ignores that line.
I've had many other lines of code do this to me, some I had to fix using what would be almost unethical ways just to get it to work. This has stumped me for some time. Could anyone give insight? I don't know if it's a matter of optimization, or something I am completely unaware of.
Thank you!

1 comment
Why is char wrapped in parenthesis everywhere