Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Cframe is not a valid member of Part "Workspace.FrigidusIncendium.HumanoidRootPart"?

Asked by 3 years ago
Edited 3 years ago

Hey there! I'm writing a script to teleport a player when they click a menu button on the screen. Everything about it works (gui fade in and camera changing) except for grabbing the humanoid and teleporting the player. I've looked online for references on how I should script this and they all show the humanoid part being grabbed, but it doesn't seem to work for me. Everything else for my Menu GUI works flawlessly, except for the Cframe teleportation. This is the line that doesn't work

player.Character.HumanoidRootPart.Cframe = CFrame.new(-19.967, 33.099, -30.647)

I have 'player' under "local player = game.Players.LocalPlayer"

Unsure of how to fix this or if there is perhaps a workaround or something I did wrong. Thank you for reading!

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Easy solution, it's CFrame, not Cframe

capitalized f

lua is case sensitive

player.Character.HumanoidRootPart.CFrame = CFrame.new(-19.967, 33.099, -30.647)
0
Whoops I didn't even catch that! I feel silly that the mistake was so small, but thank you so much! FrigidusIncendium 24 — 3y
Ad

Answer this question