The script is supposed to make the part face the player, I tested it out in studio and it worked fine, but when I tested it ingame, the script doesnt work.
function MakeRightSurfaceFace(Pos, LookAt)
local Up = Vector3.new(0,1,0);
local LookAtDirection = (LookAt - Pos).unit
if (LookAtDirection.Y > 0.98) then
Up = Vector3.new(0,1,0);
end
local ZAxis = LookAtDirection:Cross(Up);
return CFrame.new(Pos.X,Pos.Y,Pos.Z,LookAtDirection.X,Up.X,ZAxis.X,LookAtDirection.Y,Up.Y,ZAxis.Y,LookAtDirection.Z,Up.Z,ZAxis.Z);
end
while wait() do
getPlayers = game.Players:GetChildren()
for i = 1, #getPlayers do
characters = getPlayers[i].Character.Torso
if characters ~= nil then
local magni = (script.Parent.Position - characters.Position).magnitude
if magni < 25 then
script.Parent.CFrame = MakeRightSurfaceFace(script.Parent.Position, characters.Position);
end
end
end
end
All help is appreciated!

2 comments
Thank you AlmostADemon!
No problem!