Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Player does not want to Move to Part?

Hey. Second question for today. I want to move Players to a specific Part, but it does not work. When I use it with NPCs, it works fine. But with Players it does not. I dont get any error or anything.

Script:

for i, plr in ipairs(workspace.InGame:GetChildren()) do
local char = game.Players:FindFirstChild(plr.Name).Character
local hum2 = char.Humanoid
local pointB = workspace.StartPoints:FindFirstChild("SP"..NumberA)

	game.ReplicatedStorage.StartGame:FireClient(game.Players:FindFirstChild(plr.Name))
	game.Players:FindFirstChild(plr.Name).Character.Humanoid.Torso.CFrame = CFrame.new(-2.75, 8.458, 53.23)
	print("SP"..NumberA)
	hum:MoveTo(pointA.Position)
	NumberA = NumberA + 1
	wait(1)
end

(The parts exist btw, that cant be the Problem)

2 answers

Torso isnt inside humanoid, but just the character.

2 comments

0

Hm, you are right. The thing is, the CFrame part works perfectly. The character gets teleported to the start. But the part where the character should move to a part does not work.

0

have you tried it without the humanoid before torso tho?

I got the answer by myself.

First of, I am dumb.

local hum2 = char.Humanoid
local pointB = workspace.StartPoints:FindFirstChild("SP"..NumberA)

hum:MoveTo(pointA.Position)

It is self explained.

Secondly, due to being in the air, the :MoveTo() got cancelled instantly, so I had to put a

wait(1)

between.

Hope this helps someone who has a similar problem.

This discussion is preserved as it was. New answers, comments, and votes are closed.