What does attempt to index nil with 'CFrame mean?

You’re doing plate.CFrame somewhere.
Replace it with plate.PrimaryPart.CFrame

I did it and now there’s this error message

Can you copy and paste line 63 real quick.

HumanoidRootPart.CFrame = plate.PrimaryPart.CFrame * CFrame.new(0,3,0)

Alright, so we need to see the code that handles spawning the Plates.
Is there any code running or all the plates are already in workspace?

no the plates are in assets there’s a code that spawns them in

Can I see the children of Plates.i1?
I’ll give you some code to run to fix it.
Tell me which part you want to be PrimaryPart aka the Part you want the Player to teleport to.


i want the player to teleport to the top

and also i want to do that its always random to which “i” the player tps but that’s for later

Alright, then you’ll need to run this to fix.

for _, plate in pairs(workspace.plates:GetChildren()) do plate.PrimaryPart = plate.top end

If you run that in your Command Bar/Line it’ll assign the PrimaryPart property to the proper Part.

Also chosing a random plate is as easy as this:

local allPlates = workspace.Plates:GetChildren()
local randomPlate = allPlates[math.random(1, #allPlates)]

but the plates are in replicated storage and in a folder called assets

then change workspace.plates to game.ReplicatedStorage.Assets.plates

1 Like