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

I have a problem the script wont teleport players i just get an error what do i do?

Asked by 3 years ago

the error is Cframe is not a valid member of Part "Workspace.Forest.SpawnPoints.SpawnPoints"

the line of code that isnt working is

character:FindFirstChild("HumanoidRootPart").Cframe = AvailableSpawnPoints[1].Cframe

the chunk of code is

local SpawnPoints = ClonedMap:FindFirstChild("SpawnPoints")

if not SpawnPoints then
        print("no spawnpoints")
    end

local AvailableSpawnPoints = SpawnPoints:GetChildren()

    for i, player in pairs(plrs) do
        if player then
            character = player.Character

            if character then
            --teleports them

            character:FindFirstChild("HumanoidRootPart").Cframe = AvailableSpawnPoints[1].Cframe
            else
            table.remove(AvailableSpawnPoints,1)


                local Sword = ServerStorage.Sword:Clone()
                Sword.Parent = player.Backpack

                local GameTag =Instance.new("BoolValue")
                GameTag.Name = "GameTag"
                GameTag.Parent = player.Character

            end

                if not player then
                    table.remove(plrs,i)

                end
            end
        end
    end
0
It's CFrame MiAiHsIs1226 189 — 3y

1 answer

Log in to vote
0
Answered by
Ludzik78 136
3 years ago

In LUA everything needs to be case sensitive. Its CFrame, not Cframe.

Ad

Answer this question