Hi! I'm trying to achieve a system where a player who is in a team has a model get teleported to it. My team system works 100% good, but my model teleporting to the player in the team doesn't work. What am I doing wrong?
local teams = game:GetService('Teams')
while true do
for _, player in pairs(teams['Survivors']:GetPlayers()) do
if player.Name ~= nil then
char = player.Character
model = game.Workspace.MonsterAI
local ch = model:GetChildren()
for _, v in pairs(ch) do
for _, v in pairs(v:GetChildren()) do
table.insert(ch, v)
end
if v:IsA("BasePart") then
model.PrimaryPart = v
break
end
end
model:MoveTo(player.Character.Torso.Position) --This is the line of code not working
end
end
wait(0.1)
end
