From my last error i had new is not a part of CFrame but now i have HumanoidRootPart is not a valid member of Model. How to fix?
character = game.Players.LocalPlayer.Character script.Parent.MouseButton1Click:Connect(function() character.HumanoidRootPart = CFrame.new(workspace.Respawn.Position) end)
The first problem:
The first problem is very strange and the HumanoidRootPart
should be there, getting the RootPart
from the property might work to fix this
The second problem:
You are trying to set the HumanoidRootPart
to a CFrame
when what you actually want is to set HumanoidRootPart.CFrame
like shown below
The solution:
character = game.Players.LocalPlayer.Character script.Parent.MouseButton1Click:Connect(function() character:FindFirstChildOfClass("Humanoid").RootPart.CFrame = CFrame.new(workspace.Respawn.Position) end)
Wiki:
Don't forget to mark my answer as the solution and upvote it if it answered your question :)