Part is not a valid member of Model "path" | Error, please help!

Greetings,

The script that this runs on is located in ServerScriptService and the part is in the specified folder, but still I don’t know what causes this error to occur. Please help! The error and code are down below.
The code:

local ToTeleport = workspace.Racetrack1.ToTeleport

The error:

image

The path:

image

Thanks!

local ToTeleport = workspace.Racetrack1:WaitForChild("ToTeleport")

I think that was my code before, but it did not work. I tried again anyways and still nope.

local Racetrack1Parts = workspace.Racetrack1:GetDescendants()
local ToTeleport

for _, part in (Racetrack1Parts) do
	if part.Name == "ToTeleport" then
		ToTeleport = part
	end
end
1 Like

racetrack1 might not have fully replicated so probably best to wait for both, i.e:

local track1 = workspace:WaitForChild("racetrack1",5);
local toTeleport = track1 and track1:WaitForChild("ToTeleport",5);
if not toTeleport then return end;
print("woop!");

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.