character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame + Vector3.new(0,10,0) table.remove(AvailableSpawnPoints,1)
character is defined as player.Character
When it tries to teleport, it gives the error CFrame is not a valid member of model
I edited this script a bit, so it is not mine and I am new to programming. Can anyone please help?
I would assume that "AvalableSpawnPoints[1]" is a model. To fix this, try replacing line 2 with:
AvailableSpawnPoints[1].Part.CFrame + Vector3.new(0,10,0)
Note: "Part" should be replaced with the name of one of the parts actually in the model saved in "AvalableSpawnPoints".
Models do not have a CFrame, while parts do, so you have to get the CFrame of a part in the model rather than the model.
Edit:
AvailableSpawnPoints = {workspace.Part} character:FindFirstChild("HumanoidRootPart").CFrame = AvailableSpawnPoints[1].CFrame + Vector3.new(0,10,0) table.remove(AvailableSpawnPoints,1)
This script works fine for me, is their any difference in your table?