I’m making a script of rounds, from beginning to end, I created a map and grouped it in a model, in it I put a part called “TPpart” that will be used to teleport the players. But when it comes time to teleport in the output it gives an error “TPpart is not a valid member of Workspace.Map”, I already searched on google what to do and found the solution of “: FindFirstChild”, but it didn’t work the same way, if someone can help me, thank you in advance.
1 Like
provide code/script location??
This is the module script inside the Main script in ServerScriptService:
for i, v in pairs (game.Players: GetPlayers ())
local character = v.Character
if character then
local TPpart = workspace.Map:FindFirstChild("TPpart ")
character.HumanoidRootPart.CFrame = TPpart.CFrame
end
end
end```
The space in the find first child call is what is causing your issues as it is different from the name of the object.
There is no space in the official script, I put it unintentionally when I went to answer Masters
If you are running this right when the game starts up, there will be no players to loop through, so nothing will happen inside the loop.
Also, you have an extra end (unless your actual code is different) are you are missing a do after
pairs (game.Players:GetPlayers())
1 Like
Thanks, I hadn’t seen this before!