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

Player spawns in a 90 degree angle most of the time?

So the problem is that the player sometimes spawns in a 90 degree angle then takes 2 seconds to stand up. Heres my code, tell me if anything is wrong.

player.CharacterAdded:Connect(function(character)
	wait()
	for i,v in pairs(findBase) do
		local owner = v:FindFirstChild("Owner")
		if v.Owner.Value == character.Name then
			local hum = character:FindFirstChild("Humanoid")
			hum.RootPart.CFrame = v.Cookie.CFrame + Vector3.new(0,5,0)
		end
	end
end)


1 answer

Since you're getting the raw CFrame of the Cookie part rotation will also be applied, since you don't want this to happen you can instead get the position of the part so rotation wont be applied.

player.CharacterAdded:Connect(function(character)
	wait()
	for i,v in pairs(findBase) do
		local owner = v:FindFirstChild("Owner")
		if v.Owner.Value == character.Name then
			local hum = character:FindFirstChild("Humanoid")
			hum.RootPart.CFrame = CFrame.new(v.Cookie.Position) + Vector3.new(0,5,0)
		end
	end
end)

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