I want this part to follow the character and constantly spin, I thought this would make the brick always spin but it only rotates once leaving the brick on an angle still following the player.
function OnPlayerEntered(player)
local a = Instance.new("Part", workspace)
a.Anchored = true
player.CharacterAdded:Connect(function(char)
while wait() do
a.CFrame = CFrame.new(char.UpperTorso.Position + Vector3.new(0,0,5)) * CFrame.fromEulerAnglesXYZ(0.1,0.1,0.1)
end
end)
end
game.Players.PlayerAdded:Connect(OnPlayerEntered)

1 comment
the parent argument to Instance.new() is deprecated. And wait() should NOT be your condition in while loops. true should've the condition for infinite loops.